@@ -56,6 +56,7 @@ incoming tipe =
57 _ -> ["v"] ==> inc tipe (ref "v")
57 _ -> ["v"] ==> inc tipe (ref "v")
59inc :: CanonicalType -> Expression () -> Expression ()
60inc :: CanonicalType -> Expression () -> Expression ()
60inc tipe x =
61inc tipe x =
61 case tipe of
62 case tipe of
@@ -114,6 +115,7 @@ inc tipe x =
114 keys = map convert fields
115 keys = map convert fields
115 convert (f,t) = (prop f, inc t (DotRef () x (var f)))
116 convert (f,t) = (prop f, inc t (DotRef () x (var f)))
117incomingTuple :: [CanonicalType] -> Expression () -> Expression ()
119incomingTuple :: [CanonicalType] -> Expression () -> Expression ()
118incomingTuple types x =
120incomingTuple types x =
119 check x JSArray (ObjectLit () fields)
121 check x JSArray (ObjectLit () fields)
@@ -127,6 +129,7 @@ incomingTuple types x =
127 , inc t (BracketRef () x (IntLit () n))
129 , inc t (BracketRef () x (IntLit () n))
130outgoing :: CanonicalType -> Expression ()
133outgoing :: CanonicalType -> Expression ()
131outgoing tipe =
134outgoing tipe =
132 case tipe of
135 case tipe of
@@ -137,6 +140,7 @@ outgoing tipe =
138 _ -> ["v"] ==> out tipe (ref "v")
141 _ -> ["v"] ==> out tipe (ref "v")
140out :: CanonicalType -> Expression () -> Expression ()
144out :: CanonicalType -> Expression () -> Expression ()
141out tipe x =
145out tipe x =
142 case tipe of
146 case tipe of
@@ -163,7 +167,7 @@ out tipe x =
163 | name `elem` ["Int","Float","Bool","String"] -> x
167 | name `elem` ["Int","Float","Bool","String"] -> x
165 Type name
169 Type name
166− | Var.isJson name -> V.value ["Native","Json"] "toJS" <| x
170+ | Var.isJson name -> x
167 | Var.isTuple name -> ArrayLit () []
171 | Var.isTuple name -> ArrayLit () []
168 | otherwise -> error "bad type got to outgoing port generation code"
172 | otherwise -> error "bad type got to outgoing port generation code"