4 ms·
You've obviously given this quite a bit of thought, given your work on the Pulsar library: https://github.com/puniverse/pulsar https://github.com/puniverse/pul
by juliangamble 13y ago
You've obviously given this quite a bit of thought, given your work on the Pulsar library:
https://github.com/puniverse/pulsar https://github.com/puniverse/pulsar
Your comment below this one focuses more on 'established practices' for large programs rather than 'is there a library that has this feature?'. I think that's just a reflection of both the state of functional programming and Clojure. They are growing and on there way to being commonly used in large systems, but not there yet (and so the practices don't exist).
For a completely different way of thinking about the problem of software composition that is more functional (although not for Newbies, not that you are) - there is lots of work going on with Monads in Clojure.
You can read about Monads in Clojure on Leonardo Borge's blog entry "Monads in Small Bites". This has some nice parallels by comparing Haskell and Clojure usage patterns.
http://www.leonardoborges.com/writings/2012/11/30/monads-in-small-bites-part-i-functors/ http://www.leonardoborges.com/writings/2012/11/30/monads-in-...
Jim Duey has put lots of work into explaining Monads in Clojure in his talk at Clojure West. The way he builds up the venn diagram is a great visual explanation (some say the addition of arrows wasn't helpful).
https://github.com/strangeloop/2011-slides/blob/master/Duey-MonadsEasy.pdf https://github.com/strangeloop/2011-slides/blob/master/Duey-...
In addition the Fluokitten library in Clojure has lots of building blocks for Monads in Clojure. You can read about it on this blog entry "Functors, Applicatives and Monads in Pictures - in Clojure". The great thing about this is the focus on boxing.
http://fluokitten.uncomplicate.org/articles/functors_applicatives_monads_in_pictures.html http://fluokitten.uncomplicate.org/articles/functors_applica...
I also saw my first Free Monad in Clojure in the wild this year:
http://stackoverflow.com/questions/20171057/is-it-possible-to-do-the-free-monad-in-clojure http://stackoverflow.com/questions/20171057/is-it-possible-t...
- pron 13y agoOne of the things I like about Clojure is that it doesn't tout itself as a "functional language", even though in many senses it is. The reason is that outside the enthusiast circles, i.e. in pretty much every enterprise, the term "functional language" is considered almost toxic; the term "monad" is highly toxic. Because Clojure has always been careful to put a lot of emphasis on practice over theory, if any monad-based approach to program composition is to be taken, a different name must be found for it. I think monads (not that I understand exactly what they are - I used to, but I forgot :)) are mostly useful for language designers. It is a very high-level abstraction, and the developer does not need to understand it in order to use a particular application of monads. In any case, anything with that even mentions the word monad can forget about widespread adoption. You can use them to build a specific API and then give it a different name, just don't mention the word.
- juliangamble 13y agoYes - I recall Simon Peyton Jones (one of the Haskell designers) commented on this in a talk when he came to town. He said, "The biggest mistake we made was calling them Monads. That's a big scary word." Re naming and specific APIs - there is a comment along these lines on this blog entry: "As you may have noticed, I reused list concatenation as monoid addition, but this makes a lot of sense, as list concatenation satisfies all the monoid laws, and no other laws. A more accessible way of saying that a type is a monoid is to say that it is combinable, addable, appendable or summable." http://tailcalled.wordpress.com/2012/04/03/translation-of-monads-are-just-monoids-in-the-category-of-endofunctors/ http://tailcalled.wordpress.com/2012/04/03/translation-of-mo... I reckon 'addable' is what you were getting at with "build a specific API and then give it a different name."