on master help sign in
Allow type annotations for infix operators.
commit1848c9542bd14ce6c67c2699c30fcc9adba22df7 authorevancz <info@elm-lang.org> dateTue 5 Feb 2013, 22:27 (14 years ago) parente0b7d26
1 file changed+3−3
elm/src/Parse/Types.hs+3−3
elm/src/Parse/Types.hs+3−3
@@ -72,9 +72,9 @@ typeAlias = do
7272 TypeAlias alias <$> toType <$> typeExpr
7373
7474typeAnnotation :: 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
7878
7979datatype :: IParser Statement
8080datatype = do