Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tibbe opened this issue Mar 15, 2012 · 8 comments · Fixed by #140
Closed

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

tibbe opened this issue Mar 15, 2012 · 8 comments · Fixed by #140

Comments

@tibbe
Copy link
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
Copy link
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
Copy link
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
Copy link
Member Author

tibbe commented Mar 15, 2012

@chrisdone I just went and checked what I use:

(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)

@pheaver
Copy link
Contributor

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
Copy link
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
Copy link
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
Copy link
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. :-)

@ivan-m
Copy link
Contributor

ivan-m commented May 15, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants