Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiWayIf - Parse error #247

Closed
pakanek opened this issue Mar 6, 2014 · 2 comments
Closed

MultiWayIf - Parse error #247

pakanek opened this issue Mar 6, 2014 · 2 comments

Comments

@pakanek
Copy link

pakanek commented Mar 6, 2014

http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/syntax-extns.html#multi-way-if
Code like:

y = if | x < 3 -> 0
       | x < 7 -> 1
       | otherwise -> 2

gives Parse error when you try to indent second line.

@abbradar
Copy link

This is really very unpleasant. As a workaround, you can use:

case () of
  _ | test1 -> ...
  _ | test2 -> ...

@kini
Copy link
Contributor

kini commented Jul 25, 2014

Yes, but the only purpose of using the MultiWayIf syntax extension in the first place is to avoid writing case () of ... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants