mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
Set 5a Ex 2: allow [Char] in addition to String
This commit is contained in:
@@ -80,6 +80,10 @@ data FieldType = SimpleType String | WeirdType
|
||||
|
||||
interpretFieldType (ConT n) = SimpleType $ nameBase n
|
||||
interpretFieldType (VarT n) = SimpleType $ nameBase n
|
||||
interpretFieldType (AppT ListT t) =
|
||||
case interpretFieldType t of
|
||||
SimpleType s -> SimpleType $ "[" ++ s ++ "]"
|
||||
_ -> WeirdType
|
||||
interpretFieldType (AppT t1 t2) =
|
||||
case (interpretFieldType t1, interpretFieldType t2) of
|
||||
(SimpleType s1, SimpleType s2) -> SimpleType $ s1 ++ " " ++ s2
|
||||
|
||||
Reference in New Issue
Block a user