Live data from Hacker News

Why monads have not taken the Common Lisp world by storm (2008)

marijnhaverbeke.nl

1–10 of 49 posts

Re: Why monads have not taken the Common Lisp world by storm (2008)

#2
I [author] must say I'm slightly embarrassed to see this turn up here now. This is not a terribly deep or interesting post. Read http://marijnhaverbeke.nl/blog/tern.html or http://marijnhaverbeke.nl/blog/acorn.html or http://marijnhaverbeke.nl/blog/browser-input-reading.html instead.

Re: Why monads have not taken the Common Lisp world by storm (2008)

#3
post #2

I [author] must say I'm slightly embarrassed to see this turn up here now. This is not a terribly deep or interesting post. Read http://marijnhaverbeke.nl/blog/tern.html or http://marijnhaverbeke.nl/blog/acorn.html or http://marijnhaverbeke.nl/blog/browser-input-reading.html instead.

I enjoyed reading the code =)

Re: Why monads have not taken the Common Lisp world by storm (2008)

#4
> It appears that in the presence of mutable state, a lot of the advantages of monads become moot.

In the simpler cases where use of monads can be replaced by simple mutable state -- you still lose out on the explicit types of the mutating vs. pure code.

For example, STM is possible because mutating effects are typed, and so can be ruled out of STM transactions.

And in the more complex monads (e.g: transformer stacks), mutable state is just not good enough. You can compose transformers to build things that mutable state simply cannot express, and you'd have to CPS transform your code and avoid mutable state to express those things.

For example, these two monads:

  ListT (ParsecT m)
  ParsecT (ListT m)
Have no corresponding "mutable state" representations.

Re: Why monads have not taken the Common Lisp world by storm (2008)

#5
post #2

I [author] must say I'm slightly embarrassed to see this turn up here now. This is not a terribly deep or interesting post. Read http://marijnhaverbeke.nl/blog/tern.html or http://marijnhaverbeke.nl/blog/acorn.html or http://marijnhaverbeke.nl/blog/browser-input-reading.html instead.

Don't be. The fundamental observation that monad's usability is tied closely to Haskell's features is important, and still hasn't been taken on board elsewhere. There's always someone trying to do monads in Clojure...

Re: Why monads have not taken the Common Lisp world by storm (2008)

#6
>That's a little too blatantly useless to be interesting though. But note how ugly CL's multiple namespaces make liftmaybe and its uses.

Oh yeah, incredibly ugly \s

OP, you may be interested in checking out LiL, the Lisp interface Library.

https://github.com/fare/lisp-interface-library

Re: Why monads have not taken the Common Lisp world by storm (2008)

#7
post #5
post #2

I [author] must say I'm slightly embarrassed to see this turn up here now. This is not a terribly deep or interesting post. Read http://marijnhaverbeke.nl/blog/tern.html or http://marijnhaverbeke.nl/blog/acorn.html or http://marijnhaverbeke.nl/blog/browser-input-reading.html instead.

Don't be. The fundamental observation that monad's usability is tied closely to Haskell's features is important, and still hasn't been taken on board elsewhere. There's always someone trying to do monads in Clojure...

Scala has plenty of monads and they work fine.

Re: Why monads have not taken the Common Lisp world by storm (2008)

#8
Incidentally, I am just reading through All About Monads (http://www.haskell.org/haskellwiki/All_About_Monads) and his point 3 ("Allow polymorphism on return types") is what confused me in this example:

  getAny :: (Random a) => State StdGen a
  getAny = do g      
I was like.. how on Earth Haskell knows which function "get" should it call? I think this is a point which should be more stressed in the tutorials (I read Learn yourself a Haskell and glanced at couple of others..)

Re: Why monads have not taken the Common Lisp world by storm (2008)

#9
post #7
post #5

Earlier quoted context omitted.

Don't be. The fundamental observation that monad's usability is tied closely to Haskell's features is important, and still hasn't been taken on board elsewhere. There's always someone trying to do monads in Clojure...

Scala has plenty of monads and they work fine.

Scala has a much more powerful type system than Clojure
Post reply on HN