on master help sign in
Allow type annotations for infix operators.
1848c95evancz
elm/src/Parse/Types.hs+3−3
@@ -72,9 +72,9 @@ typeAlias = do
72 TypeAlias alias <$> toType <$> typeExpr
72 TypeAlias alias <$> toType <$> typeExpr
73
73
74typeAnnotation :: IParser Statement
74typeAnnotation :: IParser Statement
75−typeAnnotation =
76− let start = do v <- lowVar ; whitespace ; hasType ; whitespace ; return v
77− in TypeAnnotation <$> try start <*> (toType <$> typeExpr)
75+typeAnnotation = TypeAnnotation <$> try start <*> (toType <$> typeExpr)
76+ where start = do v <- lowVar <|> parens symOp
77+ whitespace ; hasType ; whitespace ; return v
78
78
79datatype :: IParser Statement
79datatype :: IParser Statement
80datatype = do
80datatype = do