Curious if anybody has already figured out satisfying (auto)indentation settings for coding in Emacs?
In accordance to common standard - basic indent of 4 spaces, 2 spaces indent for where,2 spaces after where and let/in etc. Alternatively by Haskell Style Guide .
I have in that sense configured external formatter fourmolu, which exactly does the job, but for the sake of me I can’t get the same within haskell-mode. Only partial results, both in default haskell-indentation-mode and haskell-indent-mode.
Can you share your setup or it is just not possible in current state of affairs. unless resort to own hacking in elisp?
However, haskell-mode indentations were pretty reasonable in last 10 years and still hold up well w.r.t. supported Haskell syntax features. Perhaps you’ll get better bung for the buck by identifying specific instances of indentation you don’t like and finding parameters that make them right.
I use haskell-indentation-mode, and I set haskell-indentation-left-offset to 4. (Note: IIRC that “4” means e.g. 4 under “do”; some other defaults already ensure 2 for “where”, 2 more under “where”.)
It is already almost perfect and flexible. There are just a few corner cases I need to manually override.