4 ms·
> Haskell functions are not Lisp functions. Lisp functions take a list of arguments, so `apply` should apply to a list of argument. I understand how currying w
by kbp 9y ago
> Haskell functions are not Lisp functions. Lisp functions take a list of arguments, so `apply` should apply to a list of argument.
I understand how currying works, thanks, but that doesn't change the fact that $ is not equivalent to apply. A version of apply that dealt with curried functions would just have to fold over a list, and I don't think it could be properly generalised in Haskell's type system (but I"m not an expert at Haskell).
For your definition of apply, Lisp-1's don't have it, because as you said, you'd just call the damn function. Lisp-2's sort of have it, but it's called funcall. Regardless, your definition of apply is not what apply is in Lisp.
- loup-vaillant 9y ago> I understand how currying works, thanks, but that doesn't change the fact that $ is not equivalent to apply. You are seeing that a square hole isn't fitting a round peg, and accusing the hole of being too sharp. Or at least millstone did. Complaining about the absence of a Clojure like `apply` function in Haskell doesn't make any sense. It would be like complaining about having to work around the lack of infix notation in Forth. Whoever does that need to let go of their old thinking habits, and rewire their brain to the new language. Not everybody can do that. Fewer still want to do that. Now if someone says, "this real world problem is easier to solve in Clojure, in Haskell you have to jump through hoops", that would be different. For the present case, one would have to show how the absence of a proper Clojure like `apply` function could force anyone to jump from any hoops to solve any concrete problem. > Regardless, your definition of apply is not what apply is in Lisp. You've either said too much, or not enough. What "apply" does mean in Lisp, then?
- deleted 9y ago[deleted]