@@ -40,10 +40,11 @@ record =
40 whitespace >> hasType >> whitespace
40 whitespace >> hasType >> whitespace
41 (,) lbl <$> expr
41 (,) lbl <$> expr
43+capTypeVar = intercalate "." <$> dotSep1 capVar
44constructor0 :: IParser T.Type
45constructor0 :: IParser T.Type
45constructor0 =
46constructor0 =
46− do name <- capVar
47+ do name <- capTypeVar
47 return (T.Data name [])
48 return (T.Data name [])
49term :: IParser T.Type
50term :: IParser T.Type
@@ -51,7 +52,7 @@ term = list <|> tuple <|> record <|> tvar <|> constructor0
52app :: IParser T.Type
53app :: IParser T.Type
54− do name <- capVar <|> try tupleCtor <?> "type constructor"
55+ do name <- capTypeVar <|> try tupleCtor <?> "type constructor"
55 args <- spacePrefix term
56 args <- spacePrefix term
56 return (T.Data name args)
57 return (T.Data name args)
@@ -70,7 +71,7 @@ expr =
70 Nothing -> return t1
71 Nothing -> return t1
72constructor :: IParser (String, [T.Type])
73constructor :: IParser (String, [T.Type])
73−constructor = (,) <$> (capVar <?> "another type constructor")
74+constructor = (,) <$> (capTypeVar <?> "another type constructor")
74 <*> spacePrefix term
75 <*> spacePrefix term
76readType :: String -> Type
77readType :: String -> Type