What is the recommended way of testing several boolean expressions ?
I’ve been using this:
case () of () | test1 -> value1
| test2 -> value2
| otherwise -> value3
Is this good style ? is there a prettier way ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This pattern can be simulated with a function — for instance,
condfrom Control.Conditional:I can’t call it particularly beautiful, though.
In next GHC we will be able to use multi-way if, hooray! (just found it out)