3 ms·
In Haskell the culture is to always do it, more or less for this reason.
by Filligree 3y ago
In Haskell the culture is to always do it, more or less for this reason.
- tromp 3y agoFor top level functions maybe, but certainly not for helper functions defined in let ... in, or where clauses.
- 7734128 3y agoHaskell, or hlint, also has the concept of eta reduce which removes documenting variable names. Just awful.
- cole-k 3y agoThe eta reduction code hint is a weird one for sure, although let's be real with Haskell naming conventions that usually means dropping an 'x'. If the linter cares so much about making code point-free maybe they should start suggesting refactors like foo x = bar x (baz x) to foo = bar <*> baz (... /s)
- mrkeen 3y agoOr another example: where genBranchLabels = do (,,,) <$> freshBranchLabel "if_" <*> freshBranchLabel "then_" <*> freshBranchLabel "else_" <*> freshBranchLabel "endif_" instead of: Cg<Tuple4<String, String, String, String>> genBranchLabels() { return freshBranchLabel("if_") .flatMap(i -> freshBranchLabel("then_") .flatMap(th -> freshBranchLabel("else_") .flatMap(el -> freshBranchLabel("endif_") .map(ei -> new Tuple4<>(i, th, el, ei))))); }