Arrows in type signatures don't align under :: #1

Closed
tibbe opened this Issue Mar 15, 2012 · 8 comments

Projects

None yet

5 participants

@tibbe
Member
tibbe commented Mar 15, 2012

I'd prefer if arrows aligned under the :: in type signatures, like so:

f :: a
  -> b

Right now we get

f :: a
    -> b

I don't know how much extra time I spend realigning things when coding. Perhaps this could be made an option if everyone can't agree on the style here?

@hvr
Member
hvr commented Mar 15, 2012

I'd just like to mention, that the indenting should also be adapted (if there needs to be done anything special) for the respective 1-character-wide UnicodeSyntax tokens, i.e.

f  a
   b
@chrisdone
Member

Surely this depends on the indentation mode? In my indentation mode if I indent -> it goes to under the ::. The ticket should specify which indentation mode.

@tibbe
Member
tibbe commented Mar 15, 2012

@chrisdone I just went and checked what I use:

(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
@pheaver
Collaborator
pheaver commented Mar 26, 2012

So there are three indentation files to choose from:

haskell-indentation.el, activated by turn-on-haskell-indentation
haskell-simple-indent.el, activated by turn-on-haskell-simple-indent
haskell-indent.el, activated by turn-on-haskell-indent

I've tried all three, and verified that the first one doesn't indent the way you want, but the other two do.

@chrisdone
Member

I've tried all three, and verified that the first one doesn't indent the way you want, but the other two do.

I believe he wants his choice of indentation module to behave in this case like the rest. So the resolution for this issue would be to patch that module unless tibbe wants to stop using this one just for this reason.

FWIW I have no intention of hacking on these indentation modes, I use haskell-simple-indent.el which I will maintain but the others are messes beyond my interest.

@hvr
Member
hvr commented Mar 26, 2012

Actually, I think @tibbe just wants something that can be tweaked to adhere to https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md... but on the other hand, Johan should just speak up for himself as to what he really wants... :-)

@chrisdone, btw will your haskell-simple-indent be flexible enough, in order to "emulate" (given appropriate configuration) the "legacy" indentation modes' styles, so that it may make those "legacy" modes redundant?

@chrisdone
Member

@hvr

haskell-simple-indent isn't mine.

It doesn't do all that the other more advanced modes do. It is very simple. It is very predictable, that's why I like it. It does the same thing every time, goes forward (tab) or backwards (S-tab) on the columns defined by previous lines. It isn't for everyone. The other tab cycle modes annoy me and distract me from coding. Most people seem to like them though. I'm just clearing up that I haven't used them for years nor do I intend do, and so I have no interest in trying to solve issues related to them. Just in case any of the other maintainers thought I might be picking tickets like this up. :-)

@gregorycollins gregorycollins pushed a commit that closed this issue May 5, 2013
@mboes mboes Align arrows in types under "::".
Fixes #1.
98aedd0
@ivan-m
ivan-m commented May 15, 2013

Was this made optional? I actually prefer having the arrows indented relative to the ::.

@geraldus geraldus added a commit to geraldus/haskell-mode that referenced this issue May 12, 2015
@geraldus geraldus Doc string updates #1 59a9335
@geraldus geraldus added a commit to geraldus/haskell-mode that referenced this issue May 12, 2015
@geraldus geraldus Update #1 f216375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment