@@ -1,26 +1,54 @@
11
22module JavaScript where
33
4+import Native.JavaScript as Native
5+
6+data JSNumber = JSNumber
7+data JSBool = JSBool
8+data JSString = JSString
9+data JSArray a = JSArray a
10+data JSDomNode = JSDomNode
411
512-- Requires that the input array be uniform (all members have the same type)
613toList : JSArray a -> [a]
14+toList = Native.toList
15+
716toInt : JSNumber -> Int
17+toInt = Native.toInt
18+
819toFloat : JSNumber -> Float
20+toFloat = Native.toFloat
21+
922toBool : JSBool -> Bool
23+toBool = Native.toBool
24+
1025toString : JSString -> String
26+toString = Native.toString
1127
1228
1329-- Produces a uniform JavaScript array with all members of the same type.
1430fromList : [a] -> JSArray a
31+fromList = Native.fromList
32+
1533fromInt : Int -> JSNumber
34+fromInt = Native.fromInt
35+
1636fromFloat : Float -> JSNumber
37+fromFloat = Native.fromFloat
38+
1739fromBool : Bool -> JSBool
40+fromBool = Native.fromBool
41+
1842fromString : String -> JSString
43+fromString = Native.fromString
1944
2045
2146-- Turn an `Element` into a plain old DOM node.
2247fromElement : Element -> JSDomNode
48+fromElement = Native.fromElement
2349
2450-- Turn a DOM node into an `Element`. You can resize the node
2551-- using the normal `width` and `height` functions.
2652toElement : Int -> Int -> JSDomNode -> Element
53+toElement = Native.toElement
54+