
11 Jun
2010
11 Jun
'10
10:06 a.m.
On 11 June 2010 14:40, Bulat Ziganshin
if x then foo else if y then bar else if z then mu else zot
case () of _ | x -> foo | y -> bar | otherwise -> zor
it's usually considered as "haskell way" of doing this
The example is merely to demonstrate how optional layout can encode useful patterns, not to claim there aren't other ways to do it in Haskell. For what it's worth, this solution is pretty hackish and so not really Haskelly.