1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 15:35:14 +03:00

Pull the rhs into a where clause.

This commit is contained in:
Rob Rix 2019-08-06 12:18:34 -04:00
parent 28404ae11e
commit b80dd5381a
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -53,7 +53,8 @@ expr :: (TokenParsing m, Monad m) => m (Term Core User)
expr = ifthenelse <|> lambda <|> rec <|> load <|> assign
assign :: (TokenParsing m, Monad m) => m (Term Core User)
assign = application <**> (flip (Core..=) <$ symbolic '=' <*> application <|> pure id) <?> "assignment"
assign = application <**> (symbolic '=' *> rhs <|> pure id) <?> "assignment"
where rhs = flip (Core..=) <$> application
application :: (TokenParsing m, Monad m) => m (Term Core User)
application = projection `chainl1` (pure (Core.$$))