[Haskell-cafe] Re: [newbie] How to test this function?
Stefan Monnier
monnier at iro.umontreal.ca
Sat Sep 23 11:41:03 EDT 2006
>>>> First, how do I fix the identation of the if then else?
>>> getList = find 5
>>> where find 0 = return []
>>> find n = do
>>> ch <- getChar
>>> if ch `elem` ['a'..'e']
>>> then do tl <- find (n-1)
>>> return (ch : tl)
>>> else find n
>>
>> OK. Thanks. I didn't find that one because it's not offered as an
>> identation option in emacs haskell mode.
It's not just a missing option, it's a bug. I'll hopefully get around to
fixing it soon.
> Emacs is evil!
Of course, that's why we like it so much.
> It also inserts random tab characters into your code just to save a few
> space bytes.
Actually, it has nothing to do with saving space: it only uses TABs because
many people *want* to use tabs. Of course, the rest of the users *doesn't
want* to use tabs, so we get to be flogged both ways.
BTW, when was the last time you tried haskell-mode? Haskell-mode (at least
since version 2.0) makes it difficult for the user to insert TABs
by mistake.
> Tends to completely trash indentation e.g. when pasting code
> into mails etc.
Huh? You mean your mail reader doesn't display tabs in the same way as
8 spaces? TABs are evil for many reasons, but I've never seen this one.
Stefan
More information about the Haskell-Cafe
mailing list