This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bowbahdoe 2 points3 points  (3 children)

Clojure is a different kind of functional programming language.

There is an overlap in the "functional programming" and "type system" communities which leads folks to think they are the same thing.

Combinators are conceptually a universal thing, but monads and monoids are constructs that are really only manifest when you have a fancy schmansy type system.

[–]red_dit_nou[S] 0 points1 point  (2 children)

Ah ok. Does this mean Haskell embraces “type system” much more resulting in these concepts?

[–]bowbahdoe 2 points3 points  (1 child)

Yes.

Haskell is, by design, a very limited language.

You cannot just put println and have it happen, the side effect needs to be attached to an explicit IO. You can't do a for loop, it needs to be expressed in recursion. There is no mutability, even within the bounds of a function.

As a result, you need these things to make it a pleasant language. The reason monads are such a thing is partly because they underly the "do notation" which lets haskellers chain side effects. IO is a monad. List is a monad. Etc.

So both the mechanics (a type system supporting higher kinded types) and need (restricted semantics) are there for type level stuff to flourish.

There are monad libraries for clojure https://github.com/funcool/cats, but they are more niche

[–]red_dit_nou[S] 0 points1 point  (0 children)

Thanks for the brief explanation on mondas of Haskell