[Haskell-cafe] How to understand such a `case` ?

Daniel Fischer daniel.is.fischer at web.de
Tue Dec 8 21:07:51 EST 2009


Am Mittwoch 09 Dezember 2009 02:26:11 schrieb zaxis:
> thanks for your quick answer ! Then what's the advantage using such a
> `case` not using `if` statement given by you ?   For me, the `if` statement
> is more clear .

Once you have a lot of possibilities to check, if-then-else cascades become rather 
unreadable. However, it might then be advisable to rethink your code, perhaps introduce a 
choice combinator.


More information about the Haskell-Cafe mailing list