[Haskell-cafe] Why doesn't this work? (palindrome :: IO)

Yves Parès limestrael at gmail.com
Fri Dec 9 11:16:05 CET 2011


I agree with all that, but in *this *special case, I think that

case something of
   True -> aaaa
   False -> bbbb

is less nice and obvious than

if something
   then aaaa
   else bbbb

2011/12/9 Brandon Allbery <allbery.b at gmail.com>

> On Fri, Dec 9, 2011 at 04:16, Yves Parès <limestrael at gmail.com> wrote:
>
>> Why do you people hate 'if' statements?
>>
>
> It's more that the language spec does; if statements, along with a number
> of other things, desugar to case which is the fundamental conditional
> construct.
>
> (And more personally, I find the indentation behavior annoying, in that I
> need to indent then and else more inside something that uses layout; plus
> the lack of an else if that is aware of being part of a compound means
> that it "ladders" even more, so I end up switching to case just to keep
> from ending up on column 200 or something.)
>
> --
> brandon s allbery                                      allbery.b at gmail.com
> wandering unix systems administrator (available)     (412) 475-9364 vm/sms
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111209/984e622c/attachment.htm>


More information about the Haskell-Cafe mailing list