This isn't an issue of what I want, but rather when I want it. haskell-mode knows how to indent these things correctly, but I had to turn off electric indentation in haskell-mode because it does stupid things the rest of the time.
Concretely, I want a haskell-mode that knows how to be electric when there's only one "right" choice and that doesn't do stupid things when there are multiple possibilities.
(I'll use | for the cursor.)
Before:
foo :: (Eq a, Num a)
=>|
After:
foo :: (Eq a, Num a)
=>|
What I wanted:
foo :: (Eq a, Num a)
=>|
In other words, =>
is an arrow like ->
, I want it indented that way :)
I concede, this is a matter of taste. I don't mind having to set some option
to pick this style, but AFAIK there is no such option.
haskell-mode seems unaware that blocks with explicit braces
(do { ... }
, let { ... }
, etc.) can be followed by where
clauses just
like layout-sensitive blocks.
Before:
foo bar baz =
do { quux <- bar baz
}
where|
After: no change (it refuses to indent)
What I wanted:
foo bar baz =
do { quux <- bar baz
}
where|