-
Notifications
You must be signed in to change notification settings - Fork 0
/
sets.hs
44 lines (38 loc) · 1.42 KB
/
sets.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{-# Language CPP #-}
{-# Language DeriveDataTypeable, StandaloneDeriving #-} -- for GHC < 7.10
import Test.Speculate hiding ((\/))
import Set hiding (set)
import qualified Set as S
#if __GLASGOW_HASKELL__ < 708
deriving instance Typeable1 S.Set
#else
deriving instance Typeable S.Set -- for GHC < 7.10
#endif
instance (Ord a, Listable a) => Listable (S.Set a) where
tiers = setCons S.set
instance Name (S.Set a) where name _ = "s"
set :: a -> S.Set a
set = undefined
main :: IO ()
main = speculate args
{ instances = [reifyInstances (set int)]
, constants =
[ constant "emptyS" $ emptyS -: set int
, constant "singleS" $ singleS -:> int
--, constant "pairS" $ pairS -:> int
, constant "insertS" $ insertS -:> int
, constant "deleteS" $ deleteS -:> int
, constant "sizeS" $ sizeS -:> set int
, constant "<~" $ (<~) -:> int
, constant "\\/" $ (\/) -:> set int
, constant "/\\" $ (/\) -:> set int
--, constant "\\\\" $ (\\) -:> set int
--, constant "<~" $ (<~) -:> set int
--, constant "subS" $ subS -:> set int
--, constant "powerS" $ powerS -:> set int
--, constant "partitionsS" $ partitionsS -:> set int
, background
, showConstant False
, showConstant True
]
}