@@ -16,7 +16,7 @@ textToText = [ "header", "italic", "bold", "underline"
1616
1717textAttrs = [ "toText" -: string ==> text
1818 , "link" -: string ==> text ==> text
19−-- , "height" -: IntT ==> text ==> text
19+ , "Text.height" -: IntT ==> text ==> text
2020 ] ++ hasType (text ==> text) textToText
2121
2222elements = let iee = IntT ==> element ==> element in
@@ -28,8 +28,52 @@ elements = let iee = IntT ==> element ==> element in
2828 , "height" -: iee
2929 , "size" -: IntT ==> iee
3030 , "box" -: iee
31+ , "centeredText" -: text ==> element
32+ , "justifiedText" -: text ==> element
33+ , "collage" -: IntT ==> IntT ==> listOf form ==> element
3134 ]
3235
36+directions = hasType direction ["up","down","left","right","inward","outward"]
37+colors = [ "rgb" -: IntT ==> IntT ==> IntT ==> color
38+ , "rgba" -: IntT ==> IntT ==> IntT ==> IntT ==> color
39+ ] ++ hasType color ["red","green","blue","black","white"]
40+
41+lineTypes = [ "line" -: listOf point ==> line
42+ , "customLine" -: listOf IntT ==> color ==> line ==> form
43+ ] ++ hasType (color ==> line ==> form) ["solid","dashed","dotted"]
44+
45+shapes = [ "polygon" -: listOf point ==> point ==> shape
46+ , "filled" -: color ==> shape ==> form
47+ , "outlined" -: color ==> shape ==> form
48+ , "customOutline" -: listOf IntT ==> color ==> shape ==> form
49+ ] ++ hasType (IntT ==> IntT ==> point ==> shape) ["ngon","rect","oval"]
50+
51+
52+-------- Signals --------
53+
54+sig ts = fn ts ==> fn (map signalOf ts)
55+ where fn = foldr1 (==>)
56+
57+signals = sequence
58+ [ do ts <- vars 1 ; "constant" -:: sig ts
59+ , do ts <- vars 2 ; "lift" -:: sig ts
60+ , do ts <- vars 3 ; "lift2" -:: sig ts
61+ , do ts <- vars 4 ; "lift3" -:: sig ts
62+ , do ts <- vars 5 ; "lift4" -:: sig ts
63+ , do [a,b] <- vars 2
64+ "foldp" -:: (a ==> b ==> b) ==> b ==> signalOf a ==> signalOf b
65+ ]
66+
67+concreteSignals =
68+ [ "Mouse.position" -: signalOf point
69+ , "Mouse.x" -: signalOf IntT
70+ , "Mouse.y" -: signalOf IntT
71+ , "Mouse.isDown" -: signalOf BoolT
72+ , "Mouse.isClicked" -: signalOf BoolT
73+ , "Window.dimensions" -: signalOf point
74+ , "Window.width" -: signalOf IntT
75+ , "Window.height" -: signalOf IntT
76+ ]
3377
3478-------- Math and Binops --------
3579
@@ -102,5 +146,8 @@ lists = liftM (map (first ("List."++)) . (++ints)) . sequence $
102146-------- Everything --------
103147
104148hints = do
105− fs <- funcs ; ls <- lists
106− return $ fs ++ ls ++ math ++ bool ++ str2elem ++ textAttrs ++ elements
149+ fs <- funcs ; ls <- lists ; ss <- signals
150+ return $ concat [ fs, ls, ss, math, bool, str2elem, textAttrs
151+ , elements, directions, colors, lineTypes, shapes
152+ , concreteSignals
153+ ]