haskell-mode indentation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

haskell-mode indentation

Kirill Kuvaldin-4

Hello there.

Being an emacs-addicted person, I'm using haskell-mode for editing haskell code.
But its default indentation rule doesn't seem to be correct.
I mean when i type something like the code below, i've got the
following indentation:

doSomeStuff a b c = do
  somefunc a
           anotherfunc b
                       onemorefunc c

Whereas the correct indentation (in my opinion) is as follows:

doSomeStuff a b c = do
  somefunc a
  anotherfunc b
  onemorefunc c

Thus I need hitting TAB key 2 or 3 times to make indentation as mentioned above.

Cheers,
Kirill

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: haskell-mode indentation

Stefan Monnier
> Being an emacs-addicted person, I'm using haskell-mode for editing
> haskell code.  But its default indentation rule doesn't seem to
> be correct.  I mean when i type something like the code below, i've got
> the  following indentation:

> doSomeStuff a b c = do
>   somefunc a
>            anotherfunc b
>                        onemorefunc c

> Whereas the correct indentation (in my opinion) is as follows:

> doSomeStuff a b c = do
>   somefunc a
>   anotherfunc b
>   onemorefunc c

Yup, there's clearly a bug here (or at least misfeature).
But at least

 doSomeStuff a b c = do
   somefunc a
            anotherfunc b
            onemorefunc c

would make sense as well, if somefunc can take 5 arguments (and
haskell-mode doesn't do any kind of type-inference, so it should
conservatively allow this indentation as well).


        Stefan


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe