by tromp · 4y ago · 0 comments
> This is shorter than the equivalent in an applicative language, because we have to name the input argument, that is only used once.
It's also wrong in that the predicate (4 >) is equivalent to (\x -> 4 > x) and thus tests for numbers being less than 4.
It's strange to argue that concatenation is structurally simpler than application, when you then need to add a quoting operator to add back the needed structure, while introducing a subtle distinction between evaluated and unevaluated code.
"Linear-style" programming becomes obvious to implement in a point-free style, but obtuse when you have variables, adding arbitrary usage restrictions.
Are you saying that in your eyes the Common Lisp and Haskell snippets are equally terse? To me the Haskell snippet looks a lot shorter and easier to read. Counting tokens also supports that judgement.
(But I'm not sure if I prefer terseness to that level. Explicitness has value too.)
(function evenp)
but instead write the shorthand version #'evenp (complement #'evenp)
vs the example: (lambda (n) (not (evenp n)))
Not much shorter by character count, but it is shorter by token count.