summaryrefslogtreecommitdiff
path: root/ddl/Language.hs
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-03-20 23:20:35 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-03-21 14:12:08 +0100
commit4d40c4ee5ed15544d2ac7fb1ea7b61e89766d277 (patch)
tree716e9b6f90bdf55b9a5f0cfe33f2b77a1b9f71b1 /ddl/Language.hs
parentc5e063b3c9aeff65161e24445e9672daff980b45 (diff)
fix c#
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