summaryrefslogtreecommitdiff
path: root/ddl/Language.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ddl/Language.hs')
-rw-r--r--ddl/Language.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/ddl/Language.hs b/ddl/Language.hs
index 989314a..afa87fa 100644
--- a/ddl/Language.hs
+++ b/ddl/Language.hs
@@ -83,7 +83,17 @@ data Type
83 83
84collectTypes :: AliasMap -> ModuleDef -> Set Type 84collectTypes :: AliasMap -> ModuleDef -> Set Type
85collectTypes aliasMap ModuleDef{..} = Set.fromList $ map (normalize aliasMap) $ concat 85collectTypes aliasMap ModuleDef{..} = Set.fromList $ map (normalize aliasMap) $ concat
86 [Data dataName : [fieldType | ConstructorDef{..} <- constructors, Field{..} <- fields] | DataDef{..} <- definitions] 86 [Data dataName : concatMap flatType [fieldType | ConstructorDef{..} <- constructors, Field{..} <- fields] | DataDef{..} <- definitions]
87 where
88 flatType t = case t of
89 V2 a -> [t,a]
90 V3 a -> [t,a]
91 V4 a -> [t,a]
92 Array a -> [t,a]
93 List a -> [t,a]
94 Maybe a -> [t,a]
95 Map k v -> [t,k,v]
96 _ -> [t]
87 97
88parens :: String -> String 98parens :: String -> String
89parens a 99parens a