@@ -1,12 +1,10 @@
11module ProjectM36.DateExamples where
22import ProjectM36.Base
3−import ProjectM36.Atom
43import qualified ProjectM36.Attribute as A
54import ProjectM36.Key
65import ProjectM36.AtomFunctions.Basic
76import ProjectM36.DataTypes.Basic
87import ProjectM36.DatabaseContext
9−import ProjectM36.DataTypes.Primitive
108import ProjectM36.Relation
119import qualified Data.Map as M
1210import qualified Data.Set as S
@@ -35,38 +33,38 @@ suppliersRel = case mkRelationFromList attrs atomMatrix of
3533 Left _ -> undefined
3634 Right rel -> rel
3735 where
38− attrs = A.attributesFromList [Attribute "s#" textAtomType,
39− Attribute "sname" textAtomType,
40− Attribute "status" intAtomType,
41− Attribute "city" textAtomType]
36+ attrs = A.attributesFromList [Attribute "s#" TextAtomType,
37+ Attribute "sname" TextAtomType,
38+ Attribute "status" IntAtomType,
39+ Attribute "city" TextAtomType]
4240 atomMatrix = [
43− [textAtom "S1", textAtom "Smith", intAtom 20, textAtom "London"],
44− [textAtom "S2", textAtom "Jones", intAtom 10, textAtom "Paris"],
45− [textAtom "S3", textAtom "Blake", intAtom 30, textAtom "Paris"],
46− [textAtom "S4", textAtom "Clark", intAtom 20, textAtom "London"],
47− [textAtom "S5", textAtom "Adams", intAtom 30, textAtom "Athens"]]
41+ [TextAtom "S1", TextAtom "Smith", IntAtom 20, TextAtom "London"],
42+ [TextAtom "S2", TextAtom "Jones", IntAtom 10, TextAtom "Paris"],
43+ [TextAtom "S3", TextAtom "Blake", IntAtom 30, TextAtom "Paris"],
44+ [TextAtom "S4", TextAtom "Clark", IntAtom 20, TextAtom "London"],
45+ [TextAtom "S5", TextAtom "Adams", IntAtom 30, TextAtom "Athens"]]
4846
4947supplierProductsRel :: Relation
5048supplierProductsRel = case mkRelationFromList attrs matrix of
5149 Left _ -> undefined
5250 Right rel -> rel
5351 where
54− attrs = A.attributesFromList [Attribute "s#" textAtomType,
55− Attribute "p#" textAtomType,
56− Attribute "qty" intAtomType]
52+ attrs = A.attributesFromList [Attribute "s#" TextAtomType,
53+ Attribute "p#" TextAtomType,
54+ Attribute "qty" IntAtomType]
5755 matrix = [
58− [textAtom "S1", textAtom "P1", intAtom 300],
59− [textAtom "S1", textAtom "P2", intAtom 200],
60− [textAtom "S1", textAtom "P3", intAtom 400],
61− [textAtom "S1", textAtom "P4", intAtom 200],
62− [textAtom "S1", textAtom "P5", intAtom 100],
63− [textAtom "S1", textAtom "P6", intAtom 100],
64− [textAtom "S2", textAtom "P1", intAtom 300],
65− [textAtom "S2", textAtom "P2", intAtom 400],
66− [textAtom "S3", textAtom "P2", intAtom 200],
67− [textAtom "S4", textAtom "P2", intAtom 200],
68− [textAtom "S4", textAtom "P4", intAtom 300],
69− [textAtom "S4", textAtom "P5", intAtom 400]
56+ [TextAtom "S1", TextAtom "P1", IntAtom 300],
57+ [TextAtom "S1", TextAtom "P2", IntAtom 200],
58+ [TextAtom "S1", TextAtom "P3", IntAtom 400],
59+ [TextAtom "S1", TextAtom "P4", IntAtom 200],
60+ [TextAtom "S1", TextAtom "P5", IntAtom 100],
61+ [TextAtom "S1", TextAtom "P6", IntAtom 100],
62+ [TextAtom "S2", TextAtom "P1", IntAtom 300],
63+ [TextAtom "S2", TextAtom "P2", IntAtom 400],
64+ [TextAtom "S3", TextAtom "P2", IntAtom 200],
65+ [TextAtom "S4", TextAtom "P2", IntAtom 200],
66+ [TextAtom "S4", TextAtom "P4", IntAtom 300],
67+ [TextAtom "S4", TextAtom "P5", IntAtom 400]
7068 ]
7169
7270productsRel :: Relation
@@ -74,16 +72,16 @@ productsRel = case mkRelationFromList attrs matrix of
7472 Left _ -> undefined
7573 Right rel -> rel
7674 where
77− attrs = A.attributesFromList [Attribute "p#" textAtomType,
78− Attribute "pname" textAtomType,
79− Attribute "color" textAtomType,
80− Attribute "weight" intAtomType,
81− Attribute "city" textAtomType]
75+ attrs = A.attributesFromList [Attribute "p#" TextAtomType,
76+ Attribute "pname" TextAtomType,
77+ Attribute "color" TextAtomType,
78+ Attribute "weight" IntAtomType,
79+ Attribute "city" TextAtomType]
8280 matrix = [
83− [textAtom "P1", textAtom "Nut", textAtom "Red", intAtom 12, textAtom "London"],
84− [textAtom "P2", textAtom "Bolt", textAtom "Green", intAtom 17, textAtom "Paris"],
85− [textAtom "P3", textAtom "Screw", textAtom "Blue", intAtom 17, textAtom "Oslo"],
86− [textAtom "P4", textAtom "Screw", textAtom "Red", intAtom 14, textAtom "London"],
87− [textAtom "P5", textAtom "Cam", textAtom "Blue", intAtom 12, textAtom "Paris"],
88− [textAtom "P6", textAtom "Cog", textAtom "Red", intAtom 19, textAtom "London"]
81+ [TextAtom "P1", TextAtom "Nut", TextAtom "Red", IntAtom 12, TextAtom "London"],
82+ [TextAtom "P2", TextAtom "Bolt", TextAtom "Green", IntAtom 17, TextAtom "Paris"],
83+ [TextAtom "P3", TextAtom "Screw", TextAtom "Blue", IntAtom 17, TextAtom "Oslo"],
84+ [TextAtom "P4", TextAtom "Screw", TextAtom "Red", IntAtom 14, TextAtom "London"],
85+ [TextAtom "P5", TextAtom "Cam", TextAtom "Blue", IntAtom 12, TextAtom "Paris"],
86+ [TextAtom "P6", TextAtom "Cog", TextAtom "Red", IntAtom 19, TextAtom "London"]
8987 ]