-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConcepts.hs
102 lines (90 loc) · 2.59 KB
/
Concepts.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
module Concepts where
data Concept a = Concept a
deriving (Eq, Ord, Show)
data Resource a = Resource a
deriving (Eq, Ord, Show)
data ResourceMap a = ResourceMap MapDescription (Resource a) (Concept a)
data MapDescription = Teaches | Requires | PartOf
deriving (Eq)
teaches :: Resource a -> Concept a -> ResourceMap a
teaches = ResourceMap Teaches
requires :: Resource a -> Concept a -> ResourceMap a
requires = ResourceMap Requires
partOf :: Resource a -> Concept a -> ResourceMap a
partOf = ResourceMap PartOf
concepts = map Concept $
[ "Mathematics"
, "Counting"
, "Addition"
, "Subtraction"
, "Multiplication"
, "Division"
, "The number line"
, "Word problems"
]
resources = map Resource $
[ "Counting with fingers"
, "Counting to 100"
, "Counting with the number line"
, "Addition with fingers"
, "Addition with the number line"
, "Subtraction with fingers"
, "Subtraction with the number line"
, "Subtraction with the word problems"
, "Multiplication with groups of addition"
, "Division with groups of subtraction"
, "Division practise"
, "Division with word problems"
, "Using money for beginners"
, "Counting groups of money"
, "Calculating differences"
, "Maths Game I"
, "Maths Game II"
, "Maths Game III"
]
resourceMaps :: [ResourceMap String]
resourceMaps = concat $
zipWith (each teaches) resources
[ ["Counting"]
, ["Counting"]
, ["Counting", "The number line"]
, ["Addition"]
, ["Addition", "The number line"]
, ["Subtraction"]
, ["Subtraction"]
, ["Subtraction"]
, ["Multiplication"]
, ["Division"]
, ["Division"]
, ["Division"]
, []
, ["Multiplication"]
, []
, []
, []
, []
]
++ zipWith (each requires) resources
[ []
, []
, []
, ["Counting"]
, ["Counting"]
, ["Counting"]
, ["Counting", "The number line"]
, ["Counting", "Word problems"]
, ["Counting", "Addition"]
, ["Counting", "Subtraction"]
, []
, ["Word problems"]
, ["Counting", "Addition"]
, ["Counting", "Addition"]
, ["Subtraction", "Word problems"]
, ["Counting"]
, ["Addition", "Subtraction"]
, ["Multiplication", "Division"]
]
++ zipWith (each partOf) resources
(repeat ["Mathematics"])
where
each f r cs = map (f r) (map Concept cs)