@@ -3,34 +3,32 @@ subsets, and split sets. Also included is a "mapping" type constructor that pair
3sets of variable-type pairs, which is used in the paper "Embedding effect systems in Haskell" (Dominic Orchard,
3sets of variable-type pairs, which is used in the paper "Embedding effect systems in Haskell" (Dominic Orchard,
4Tomas Petricek <http://www.cl.cam.ac.uk/~dao29/publ/haskell14-effects.pdf>) to embed effect sets.
4Tomas Petricek <http://www.cl.cam.ac.uk/~dao29/publ/haskell14-effects.pdf>) to embed effect sets.
6−Here is some example code!
6+A full example can be seen in 'example.hs'. Here is a shorter version:
9 {-# LANGUAGE DataKinds, TypeOperators #-}
8 {-# LANGUAGE DataKinds, TypeOperators #-}
11 import Data.Type.Set
10 import Data.Type.Set
13− -- foo :: Set '["x" :-> Integer, "z" :-> Integer]
12+ -- foo :: Set '["x" :-> Int, "z" :-> Int]
14 foo = Ext ((Var :: (Var "x")) :-> 2) $
13 foo = Ext ((Var :: (Var "x")) :-> 2) $
15 Ext ((Var :: (Var "z")) :-> 4) $
14 Ext ((Var :: (Var "z")) :-> 4) $
18− -- bar :: Set '["y" :-> Integer, "w" :-> Integer]
17+ -- bar :: Set '["y" :-> Int, "w" :-> Int]
19 bar = Ext ((Var :: (Var "y")) :-> 3) $
18 bar = Ext ((Var :: (Var "y")) :-> 3) $
20 Ext ((Var :: (Var "w")) :-> 1) $
19 Ext ((Var :: (Var "w")) :-> 1) $
23− -- foobar :: Set '["w" :-> Integer, "x" :-> Integer, "y" :-> Integer, "z" :-> Integer]
22+ -- foobar :: Set '["w" :-> Int, "x" :-> Int, "y" :-> Int, "z" :-> Int]
24 foobar = foo `union` bar
23 foobar = foo `union` bar
25+Note, that 'foobar' shows the sorted
27−Note, the type signatures are commented out here as they can be inferred.
26+the type signatures are commented out here as they can be inferred.
28Example execution:
27Example execution:
31 *Main> foobar
29 *Main> foobar
32 {(Var :-> 1), (Var :-> 2), (Var :-> 3), (Var :-> 4)}
30 {(Var :-> 1), (Var :-> 2), (Var :-> 3), (Var :-> 4)}