mirror of
https://github.com/ilyakooo0/elm-bridge.git
synced 2024-09-11 14:05:55 +03:00
Fix toElmType for tuple type
This commit is contained in:
parent
c99f8cd96a
commit
e9347d3baa
@ -175,7 +175,7 @@ toElmType ty = toElmType' $ typeRep ty
|
||||
-- List is special because the constructor name is [] in Haskell and List in elm
|
||||
| con == (typeRepTyCon $ typeRep (Proxy :: Proxy [])) = ETyApp (ETyCon $ ETCon $ "List") (toElmType' (head args))
|
||||
-- The unit type '()' is a 0-ary tuple.
|
||||
| isTuple $ tyConName con = ETyTuple $ length args
|
||||
| isTuple $ tyConName con = foldl ETyApp (ETyTuple $ length args) $ map toElmType' args
|
||||
| otherwise = typeApplication con args
|
||||
where
|
||||
(con, args) = splitTyConApp rep
|
||||
|
Loading…
Reference in New Issue
Block a user