haskell-style-guide
haskell-style-guide copied to clipboard
Add examples how to break long function headers
How shall a function with long list of arguments be broken?
What of the following is acceptable (n.b. the max line length was shortened artificially for illustration)? where shall the =
-sign land?
longfunname arg1 arg2 arg3 arg4 arg5 arg5
= long body ...
longfunname arg1 arg2 arg3 arg4 arg5 arg5 =
long body ...
longfunname arg1 arg2 arg3 arg4 arg5 arg5
(Cons1 arg6 arg7 arg8 arg9)
= long body ...
-- note the weird ()-brackets
longfunname arg1
arg2 arg3 arg4
arg5 arg5 (Cons1
arg6 arg7arg8
arg9)
= long body ...
-- ... ?