@@ -19,7 +19,7 @@ task name expr portType =
19 _Task "perform" `call` [ expr ]
19 _Task "perform" `call` [ expr ]
21 T.Signal _ _ ->
21 T.Signal _ _ ->
22− _Task "performSignal" `call` [ string name, expr ]
22+ _Task "performSignal" `call` [ StringLit () name, expr ]
@@ -77,7 +77,7 @@ check x jsType continue =
77 foldl1 (InfixExpr () op) (map ($ value) checks)
77 foldl1 (InfixExpr () op) (map ($ value) checks)
80− obj ["_U","badPort"] `call` [ string (typeToString jsType), x ]
80+ obj ["_U","badPort"] `call` [ StringLit () (typeToString jsType), x ]
83 case jsType of
83 case jsType of
@@ -96,22 +96,22 @@ inbound name portType =
96 case portType of
96 case portType of
97 T.Normal tipe ->
97 T.Normal tipe ->
98 _Port "inbound" `call`
98 _Port "inbound" `call`
99− [ string name
99+ [ StringLit () name
100− , string (show (P.pretty Map.empty False tipe))
100+ , StringLit () (show (P.pretty Map.empty False tipe))
101 , toTypeFunction tipe
101 , toTypeFunction tipe
104 T.Signal _root arg ->
104 T.Signal _root arg ->
105 _Port "inboundSignal" `call`
105 _Port "inboundSignal" `call`
106− [ string name
106+ [ StringLit () name
107− , string (show (P.pretty Map.empty False arg))
107+ , StringLit () (show (P.pretty Map.empty False arg))
108 , toTypeFunction arg
108 , toTypeFunction arg
112toTypeFunction :: T.Canonical -> Expression ()
112toTypeFunction :: T.Canonical -> Expression ()
113toTypeFunction tipe =
113toTypeFunction tipe =
114− ["v"] ==> toType tipe (ref "v")
114+ function ["v"] [ ReturnStmt () (Just (toType tipe (ref "v"))) ]
117toType :: T.Canonical -> Expression () -> Expression ()
117toType :: T.Canonical -> Expression () -> Expression ()
@@ -186,7 +186,7 @@ toTuple types x =
186 (prop "ctor", ctor) : zipWith convert [0..] types
186 (prop "ctor", ctor) : zipWith convert [0..] types
189− string ("_Tuple" ++ show (length types))
189+ StringLit () ("_Tuple" ++ show (length types))
191 convert n t =
191 convert n t =
192 ( prop ('_':show n)
192 ( prop ('_':show n)
@@ -200,15 +200,15 @@ outbound :: String -> Expression () -> T.Port T.Canonical -> Expression ()
200outbound name expr portType =
200outbound name expr portType =
201 case portType of
201 case portType of
202 T.Normal tipe ->
202 T.Normal tipe ->
203− _Port "outbound" `call` [ string name, fromTypeFunction tipe, expr ]
203+ _Port "outbound" `call` [ StringLit () name, fromTypeFunction tipe, expr ]
205 T.Signal _ arg ->
205 T.Signal _ arg ->
206− _Port "outboundSignal" `call` [ string name, fromTypeFunction arg, expr ]
206+ _Port "outboundSignal" `call` [ StringLit () name, fromTypeFunction arg, expr ]
209fromTypeFunction :: T.Canonical -> Expression ()
209fromTypeFunction :: T.Canonical -> Expression ()
210fromTypeFunction tipe =
210fromTypeFunction tipe =
211− ["v"] ==> fromType tipe (ref "v")
211+ function ["v"] [ ReturnStmt () (Just (fromType tipe (ref "v"))) ]
214fromType :: T.Canonical -> Expression () -> Expression ()
214fromType :: T.Canonical -> Expression () -> Expression ()
@@ -230,7 +230,7 @@ fromType tipe x =
230 func body =
230 func body =
231 function (take numArgs args)
231 function (take numArgs args)
232 [ VarDeclStmt () [VarDecl () (var "_r") (Just body)]
232 [ VarDeclStmt () [VarDecl () (var "_r") (Just body)]
233− , ret (fromType (last ts) (ref "_r"))
233+ , ReturnStmt () (Just (fromType (last ts) (ref "_r")))
236 T.Var _ ->
236 T.Var _ ->
@@ -250,7 +250,7 @@ fromType tipe x =
250 T.Type name : [t]
250 T.Type name : [t]
251 | Var.isMaybe name ->
251 | Var.isMaybe name ->
252 CondExpr ()
252 CondExpr ()
253− (equal (DotRef () x (var "ctor")) (string "Nothing"))
253+ (equal (DotRef () x (var "ctor")) (StringLit () "Nothing"))
254 (NullLit ())
254 (NullLit ())
255 (fromType t (DotRef () x (var "_0")))
255 (fromType t (DotRef () x (var "_0")))