@@ -19,7 +19,7 @@ task name expr portType =
1919 _Task "perform" `call` [ expr ]
2020
2121 T.Signal _ _ ->
22− _Task "performSignal" `call` [ string name, expr ]
22+ _Task "performSignal" `call` [ StringLit () name, expr ]
2323
2424
2525
@@ -77,7 +77,7 @@ check x jsType continue =
7777 foldl1 (InfixExpr () op) (map ($ value) checks)
7878
7979 throw =
80− obj ["_U","badPort"] `call` [ string (typeToString jsType), x ]
80+ obj ["_U","badPort"] `call` [ StringLit () (typeToString jsType), x ]
8181
8282 checks =
8383 case jsType of
@@ -96,22 +96,22 @@ inbound name portType =
9696 case portType of
9797 T.Normal tipe ->
9898 _Port "inbound" `call`
99− [ string name
100− , string (show (P.pretty Map.empty False tipe))
99+ [ StringLit () name
100+ , StringLit () (show (P.pretty Map.empty False tipe))
101101 , toTypeFunction tipe
102102 ]
103103
104104 T.Signal _root arg ->
105105 _Port "inboundSignal" `call`
106− [ string name
107− , string (show (P.pretty Map.empty False arg))
106+ [ StringLit () name
107+ , StringLit () (show (P.pretty Map.empty False arg))
108108 , toTypeFunction arg
109109 ]
110110
111111
112112toTypeFunction :: T.Canonical -> Expression ()
113113toTypeFunction tipe =
114− ["v"] ==> toType tipe (ref "v")
114+ function ["v"] [ ReturnStmt () (Just (toType tipe (ref "v"))) ]
115115
116116
117117toType :: T.Canonical -> Expression () -> Expression ()
@@ -186,7 +186,7 @@ toTuple types x =
186186 (prop "ctor", ctor) : zipWith convert [0..] types
187187
188188 ctor =
189− string ("_Tuple" ++ show (length types))
189+ StringLit () ("_Tuple" ++ show (length types))
190190
191191 convert n t =
192192 ( prop ('_':show n)
@@ -200,15 +200,15 @@ outbound :: String -> Expression () -> T.Port T.Canonical -> Expression ()
200200outbound name expr portType =
201201 case portType of
202202 T.Normal tipe ->
203− _Port "outbound" `call` [ string name, fromTypeFunction tipe, expr ]
203+ _Port "outbound" `call` [ StringLit () name, fromTypeFunction tipe, expr ]
204204
205205 T.Signal _ arg ->
206− _Port "outboundSignal" `call` [ string name, fromTypeFunction arg, expr ]
206+ _Port "outboundSignal" `call` [ StringLit () name, fromTypeFunction arg, expr ]
207207
208208
209209fromTypeFunction :: T.Canonical -> Expression ()
210210fromTypeFunction tipe =
211− ["v"] ==> fromType tipe (ref "v")
211+ function ["v"] [ ReturnStmt () (Just (fromType tipe (ref "v"))) ]
212212
213213
214214fromType :: T.Canonical -> Expression () -> Expression ()
@@ -230,7 +230,7 @@ fromType tipe x =
230230 func body =
231231 function (take numArgs args)
232232 [ VarDeclStmt () [VarDecl () (var "_r") (Just body)]
233− , ret (fromType (last ts) (ref "_r"))
233+ , ReturnStmt () (Just (fromType (last ts) (ref "_r")))
234234 ]
235235
236236 T.Var _ ->
@@ -250,7 +250,7 @@ fromType tipe x =
250250 T.Type name : [t]
251251 | Var.isMaybe name ->
252252 CondExpr ()
253− (equal (DotRef () x (var "ctor")) (string "Nothing"))
253+ (equal (DotRef () x (var "ctor")) (StringLit () "Nothing"))
254254 (NullLit ())
255255 (fromType t (DotRef () x (var "_0")))
256256