~alcinnz/fontconfig-pure

ref: 04e3e462ef4e7ce094848c0ea1424f1624f8bf9a fontconfig-pure/lib/Graphics/Text/Font/Choose/LangSet.hs -rw-r--r-- 444 bytes
04e3e462 — Adrian Cochrane Draft C-side wrappers for various FontConfig APIs. 8 months ago
                                                                                
4da6f787 Adrian Cochrane
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Graphics.Text.Font.Choose.LangSet where

import Data.Set (Set)
import qualified Data.Set as S

import Data.MessagePack (MessagePack(..))

type LangSet = Set String
newtype LangSet' = LangSet' { unLangSet :: LangSet }

instance MessagePack LangSet' where
    toObject = toObject . S.toList . unLangSet
    fromObject msg = LangSet' <$> S.fromList <$> fromObject msg

-- TODO: Implement language bindings! But first: Datamodel everything!