~alcinnz/fontconfig-pure

ref: c406e2016b6ae9b909501c05c5790693092447e3 fontconfig-pure/lib/Graphics/Text/Font/Choose/StrSet.hs -rw-r--r-- 494 bytes
c406e201 — Adrian Cochrane Properly handle ambiguity in empty char/lang sets. 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Graphics.Text.Font.Choose.StrSet(StrSet(..), module S) where

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

import Data.MessagePack (MessagePack(..))
import Test.QuickCheck (Arbitrary(..))

newtype StrSet = StrSet { unStrSet :: Set String } deriving (Eq, Show, Read)

instance MessagePack StrSet where
    toObject = toObject . S.toList . unStrSet
    fromObject msg = StrSet <$> S.fromList <$> fromObject msg
instance Arbitrary StrSet where
    arbitrary = StrSet <$> arbitrary