2 ms·
That’s not really what I’m referring to. There’s actually a tool in Haskell that can rewrite code into a points free style, and it can handle much more complica
by klodolph 4y ago
That’s not really what I’m referring to. There’s actually a tool in Haskell that can rewrite code into a points free style, and it can handle much more complicated cases than just simple composition, it can handle multiple uses of a variable, it can eliminate multiple variables, etc. you can create some real incomprehensible stuff this way.
Edit: Here's a Haskell wiki article:
https://wiki.haskell.org/Pointfree https://wiki.haskell.org/Pointfree
> Point-free style can (clearly) lead to Obfuscation when used unwisely. As higher-order functions are chained together, it can become harder to mentally infer the types of expressions. The mental cues to an expression's type (explicit function arguments, and the number of arguments) go missing.
> Point-free style often times leads to code which is difficult to modify. A function written in a pointfree style may have to be radically changed to make minor changes in functionality. This is because the function becomes more complicated than a composition of lambdas and other functions, and compositions must be changed to application for a pointful function.
> Perhaps these are why pointfree style is sometimes (often?) referred to as pointless style.
I have observed some relatively extreme examples of pointfree in the wild, and that's what I'm referring to.