@@ -80,7 +80,12 @@ lambdaExpr = do char '\\' <|> char '\x03BB' <?> "anonymous function"
8080 return $ makeFunction args e
8181
8282assignExpr = do
83− patterns <- spaceSep1 (patternTerm <?> "the definition of a variable (x = ...)")
83+ patterns <-
84+ choice [ try $ do v <- PVar <$> lowVar
85+ notFollowedBy (whitespace >> char ':')
86+ (v:) <$> spacePrefix patternTerm
87+ , (:[]) <$> patternExpr
88+ ] <?> "the definition of a variable (x = ...)"
8489 whitespace; string "="; whitespace; exp <- expr
8590 flattenPatterns patterns exp
8691