[Haskell-cafe] Code folding in Emacs

Valery V. Vorotyntsev valery.vv at gmail.com
Mon Jan 14 08:30:38 EST 2008


On 1/14/08, Johan Tibell <johan.tibell at gmail.com> wrote:
> It would be pretty neat for Haskell hacking if the Emacs Haskell mode
> could do the following. Imagine you have written some code like so:
>
> [...]
>
> Binding a haskell-fold-source function to a key chain would enable you
> to get a quick overview of your module showing only the comments and
> type signatures. I've used the little function from
> http://emacs.wordpress.com/2007/01/16/quick-and-dirty-code-folding/
> but it doesn't work well together with indented type signatures like
> in the example above.

AFAIU the problem, ..

data StupidTypeNameIntendedToBeLong =
    Foo

functionWithLoooongName :: Foo
                        -> Bar
functionWithLoooongName = undefined

.. you don't like the way haskell-mode indents the `-> Bar' line.

If this is the case, you could `newline-and-indent' (`C-j') right
after `::'.

anotherFunctionWithLongName ::
    Foo -> Bar
anotherFunctionWithLongName = undefined

And what's this "haskell-fold-source function" you were talking about?

--
vvv


More information about the Haskell-Cafe mailing list