on master help sign in
Rename JSIntNumber to JSInt and use (<|)
commite7a455109a56f8a5ba62e705b9823c4724c6668b authorEvan Czaplicki <info@elm-lang.org> dateTue 17 Nov 2015, 11:24 (11 years ago) parent3b5542d
1 file changed+6−6
src/Generate/JavaScript/Port.hs+6−6
src/Generate/JavaScript/Port.hs+6−6
@@ -27,7 +27,7 @@ task name expr portType =
2727
2828data JSType
2929 = JSNumber
30− | JSIntNumber
30+ | JSInt
3131 | JSBoolean
3232 | JSString
3333 | JSArray
@@ -38,7 +38,7 @@ typeToString :: JSType -> String
3838typeToString tipe =
3939 case tipe of
4040 JSNumber -> "a number"
41− JSIntNumber -> "an integer"
41+ JSInt -> "an integer"
4242 JSBoolean -> "a boolean (true or false)"
4343 JSString -> "a string"
4444 JSArray -> "an array"
@@ -84,7 +84,7 @@ check x jsType continue =
8484 checks =
8585 case jsType of
8686 JSNumber -> [typeof "number"]
87− JSIntNumber ->
87+ JSInt ->
8888 [jsFold OpLAnd (typeof "number" : intChecks)]
8989 JSBoolean -> [typeof "boolean"]
9090 JSString -> [typeof "string", instanceof "String"]
@@ -93,8 +93,8 @@ check x jsType continue =
9393 [jsFold OpLAnd (typeof "object" : map member fields)]
9494
9595 intChecks =
96− [ \x -> (ref "isFinite") `call` [x]
97− , \x -> equal (obj ["Math","floor"] `call` [x]) x
96+ [ \x -> ref "isFinite" <| x
97+ , \x -> equal (obj ["Math","floor"] <| x) x
9898 ]
9999
100100
@@ -137,7 +137,7 @@ toType tipe x =
137137
138138 T.Type (Var.Canonical Var.BuiltIn name)
139139 | name == "Float" -> from JSNumber
140− | name == "Int" -> from JSIntNumber
140+ | name == "Int" -> from JSInt
141141 | name == "Bool" -> from JSBoolean
142142 | name == "String" -> from JSString
143143 where