@@ -9,6 +9,7 @@ import Parse.Helpers as Help
9import qualified Parse.Type as Type
9import qualified Parse.Type as Type
12declaration :: IParser D.SourceDecl
13declaration :: IParser D.SourceDecl
13declaration =
14declaration =
@@ -17,8 +18,10 @@ declaration =
20-- TYPE ANNOTATIONS and DEFINITIONS
22-- TYPE ANNOTATIONS and DEFINITIONS
22definition :: IParser D.SourceDecl'
25definition :: IParser D.SourceDecl'
23definition =
26definition =
24 D.Definition
27 D.Definition
@@ -26,8 +29,10 @@ definition =
26 <?> "a value definition"
29 <?> "a value definition"
29-- TYPE ALIAS and UNION TYPES
33-- TYPE ALIAS and UNION TYPES
31typeDecl :: IParser D.SourceDecl'
36typeDecl :: IParser D.SourceDecl'
33 do try (reserved "type") <?> "a type declaration"
38 do try (reserved "type") <?> "a type declaration"
@@ -48,8 +53,10 @@ typeDecl =
48 return $ D.Datatype name args tcs
53 return $ D.Datatype name args tcs
53infixDecl :: IParser D.SourceDecl'
60infixDecl :: IParser D.SourceDecl'
54infixDecl =
61infixDecl =
55 expecting "an infix declaration" $
62 expecting "an infix declaration" $
@@ -65,8 +72,10 @@ infixDecl =
65 D.Fixity assoc (read [n]) <$> anyOp
72 D.Fixity assoc (read [n]) <$> anyOp
70port :: IParser D.SourceDecl'
79port :: IParser D.SourceDecl'
72 expecting "a port declaration" $
81 expecting "a port declaration" $