@@ -16,14 +16,14 @@ textToText = [ "header", "italic", "bold", "underline"
1616
1717textAttrs = [ "toText" -: string ==> text
1818 , "link" -: string ==> text ==> text
19− , "Text.height" -: int ==> text ==> text
19+ , numScheme (\t -> t ==> text ==> text) "Text.height"
2020 ] ++ hasType (text ==> text) textToText
2121
2222elements = let iee = int ==> element ==> element in
2323 [ "flow" -: direction ==> listOf element ==> element
2424 , "layers" -: listOf element ==> element
2525 , "text" -: text ==> element
26− , "opacity" -: iee
26+ , "opacity" -: float ==> element ==> element
2727 , "width" -: iee
2828 , "height" -: iee
2929 , "size" -: int ==> iee
@@ -34,19 +34,22 @@ elements = let iee = int ==> element ==> element in
3434 ]
3535
3636directions = hasType direction ["up","down","left","right","inward","outward"]
37−colors = [ "rgb" -: int ==> int ==> int ==> color
38− , "rgba" -: int ==> int ==> int ==> int ==> color
39− ] ++ hasType color ["red","green","blue","black","white"]
37+colors = [ numScheme (\n -> n ==> n ==> n ==> color) "rgb"
38+ , numScheme (\n -> n ==> n ==> n ==> n ==> color) "rgba"
39+ ] ++ hasType color ["red","green","blue","black","white"
40+ ,"yellow","cyan","magenta","grey","gray"]
4041
41−lineTypes = [ "line" -: listOf point ==> line
42+lineTypes = [ numScheme (\n -> listOf (pairOf n) ==> line) "line"
4243 , "customLine" -: listOf int ==> color ==> line ==> form
4344 ] ++ hasType (color ==> line ==> form) ["solid","dashed","dotted"]
4445
45−shapes = [ "polygon" -: listOf point ==> point ==> shape
46+shapes = [ numScheme (\n -> listOf (pairOf n) ==> pairOf n ==> shape) "polygon"
4647 , "filled" -: color ==> shape ==> form
4748 , "outlined" -: color ==> shape ==> form
4849 , "customOutline" -: listOf int ==> color ==> shape ==> form
49− ] ++ hasType (int ==> int ==> point ==> shape) ["ngon","rect","oval"]
50+ ] ++ map (numScheme (\n -> n ==> n ==> pairOf n ==> shape) [ "ngon"
51+ , "rect"
52+ , "oval" ]
5053
5154
5255-------- Foreign --------
@@ -132,14 +135,14 @@ math =
132135 map (numScheme (\t -> t ==> binop t)) ["clamp"] ++
133136 map (numScheme (\t -> binop t)) ["+","-","*","max","min"] ++
134137 [ numScheme (\t -> t ==> t) "abs" ] ++
135− [ "/" -: binop float ] ++
136− hasType (binop int) ["rem","div","mod","logBase"] ++
137− hasType (float ==> float) ["sin","cos","tan","asin","acos","atan","sqrt"]
138+ hasType (binop float) [ "/", "logBase" ] ++
139+ hasType (binop int) ["rem","div","mod"] ++
140+ hasType (float ==> float) ["sin","cos","tan","asin","acos","atan","sqrt"] ++
138141
139142bools =
140143 [ "not" -: bool ==> bool ] ++
141144 hasType (binop bool) ["&&","||"] ++
142− hasType (int ==> int ==> bool) ["<",">","<=",">="]
145+ map (numScheme (\n -> n ==> n ==> bool)) ["<",">","<=",">="]
143146
144147
145148-------- Polymorphic Functions --------
@@ -171,7 +174,7 @@ funcs =
171174lists =
172175 [ "and" -:: listOf bool ==> bool
173176 , "or" -:: listOf bool ==> bool
174− , "sort" -:: listOf int ==> listOf int
177+ , numScheme (\n -> listOf n ==> listOf n) "sort"
175178 , "head" -:: listOf a ==> a
176179 , "tail" -:: listOf a ==> listOf a
177180 , "length" -:: listOf a ==> int
@@ -195,7 +198,8 @@ lists =
195198 , "scanl" -:: (a ==> b ==> b) ==> b ==> listOf a ==> listOf b
196199 , "concatMap" -:: (a ==> listOf b) ==> listOf a ==> listOf b
197200 , "zipWith" -:: (a ==> b ==> c) ==> listOf a ==> listOf b ==> listOf c
198− ] ++ map (-: (listOf int ==> int)) [ "sum","product","maximum","minimum" ]
201+ ] ++ map (numScheme (\n -> listOf n ==> n)) [ "sum", "product"
202+ , "maximum", "minimum" ]
199203
200204
201205-------- Everything --------