@@ -9,12 +9,13 @@ The following shows an example:
99
1010 import Data.Type.Set
1111
12− -- foo :: Set '["x" :-> Int, "z" :-> Int]
12+ foo :: Set '["x" :-> Int, "z" :-> Int, "w" :-> Int]
1313 foo = Ext ((Var :: (Var "x")) :-> 2) $
1414 Ext ((Var :: (Var "z")) :-> 4) $
15+ Ext ((Var :: (Var "w")) :-> 5) $
1516 Empty
1617
17− -- bar :: Set '["y" :-> Int, "w" :-> Int]
18+ bar :: Set '["y" :-> Int, "w" :-> Int]
1819 bar = Ext ((Var :: (Var "y")) :-> 3) $
1920 Ext ((Var :: (Var "w")) :-> 1) $
2021 Empty
@@ -22,13 +23,13 @@ The following shows an example:
2223 -- foobar :: Set '["w" :-> Int, "x" :-> Int, "y" :-> Int, "z" :-> Int]
2324 foobar = foo `union` bar
2425
25−Note, that 'foobar' shows the sorted
26−the type signatures are commented out here as they can be inferred.
27−Example execution:
26+The 'Set' type for 'foobar' here shows the normalised form (sorted with no duplicates).
27+The type signatures is commented out as it can be infered. Running the example we get:
2828
2929 *Main> foobar
3030 {(Var :-> 1), (Var :-> 2), (Var :-> 3), (Var :-> 4)}
3131
32+Thus, we see that the first value for "w" is dropped.
3233
3334
3435