Live data from Hacker News

A difference between Haskell and Common Lisp

chrisdone.com

1–10 of 203 posts

Re: A difference between Haskell and Common Lisp

#3
Is this really a philosophical difference? Granted, I've only used Clojure as far as Lisps go, but composability seems to be something that's emphasized.

Rather than

   (remove-if-not #'p xs :count 5 :start 3)
It seems to me like most Clojure users would do something like

   (->> xs (drop 3) (filter p) (take 5))
which is much closer to

   take 5 . filter p . drop 3

Re: A difference between Haskell and Common Lisp

#4

Is this really a philosophical difference? Granted, I've only used Clojure as far as Lisps go, but composability seems to be something that's emphasized. Rather than (remove-if-not #'p xs :count 5 :start 3) It seems to me like most Clojure users would do something like (->> xs (drop 3) (filter p) (take 5)) which is much closer to take 5 . filter p . drop 3

Unlike CL/EL, Clojure is lazy by default. So it's closer to Haskell in that regard.

Re: A difference between Haskell and Common Lisp

#5
You have to be clear about which Lisp. Clojure and Scheme are Lisps, and their focus is very much towards simplicity and the use of combinators.

The complex, do-it-all-in-one-huge macro is a Common Lispism, not a Lispism.

Secondly, Clojure, like Haskell, is focused on sequence abstractions, not lists. Sequences can include collections, streams, observables, sockets and many other kinds of process that can be modelled as an event stream.

Re: A difference between Haskell and Common Lisp

#6
post #4

Is this really a philosophical difference? Granted, I've only used Clojure as far as Lisps go, but composability seems to be something that's emphasized. Rather than (remove-if-not #'p xs :count 5 :start 3) It seems to me like most Clojure users would do something like (->> xs (drop 3) (filter p) (take 5)) which is much closer to take 5 . filter p . drop 3

Unlike CL/EL, Clojure is lazy by default. So it's closer to Haskell in that regard.

It's not really lazy by default, it just has a lazy stream type with nice syntax.

Re: A difference between Haskell and Common Lisp

#7
post #4

Is this really a philosophical difference? Granted, I've only used Clojure as far as Lisps go, but composability seems to be something that's emphasized. Rather than (remove-if-not #'p xs :count 5 :start 3) It seems to me like most Clojure users would do something like (->> xs (drop 3) (filter p) (take 5)) which is much closer to take 5 . filter p . drop 3

Unlike CL/EL, Clojure is lazy by default. So it's closer to Haskell in that regard.

Clojure isn't lazy by default. It is a strict language with lazy streams in the standard library.

Re: A difference between Haskell and Common Lisp

#8
post #4

Earlier quoted context omitted.

Unlike CL/EL, Clojure is lazy by default. So it's closer to Haskell in that regard.

Clojure isn't lazy by default. It is a strict language with lazy streams in the standard library.

Sorry, yes. That's what I meant.

Re: A difference between Haskell and Common Lisp

#10

Is this really a philosophical difference? Granted, I've only used Clojure as far as Lisps go, but composability seems to be something that's emphasized. Rather than (remove-if-not #'p xs :count 5 :start 3) It seems to me like most Clojure users would do something like (->> xs (drop 3) (filter p) (take 5)) which is much closer to take 5 . filter p . drop 3

Minor nitpick. Technically, this:

    #(->> % (drop 3) (filter p) (take 5))
Is equivalent to:

    take 5 . filter p . drop 3
Post reply on HN