On Nov 21, 3:14 am, Konrad Hinsen <[EMAIL PROTECTED]> wrote:
> As a first non-trivial exercice, I wrote an implementation of monads  
> in Clojure. I just uploaded it to the Group:
>
>        http://clojure.googlegroups.com/web/monads.clj
>
> The file contains the macro definitions, the definitions of three  
> popular monads (maybe, list, state), and some illustrations of their  
> use. Comments are welcome!

Since they support mzero and mplus, aren't these equivalent to
Haskell's MonadPlus? (i.e. they're a little more than *just* monads)
I'm trying to work my way through that material too, so I'm not
entirely sure. Either way, cool stuff.

I've been kicking around the idea of re-implementing Haskell
typeclasses on top of multimethods. Now that I think more about it,
this probably wouldn't be much work. The two big issues I can see are
ensuring incomplete instances can't be created and figuring out how
the dispatch function can work sanely. Haskell has an advantage here
in that the only thing typeclasses dispatch on is the types involved,
so it's trivial to not clobber any existing definitions.

-Adam

>
> One thing I was wondering about: if I want to turn this into a  
> library module, where could I place it in Java's namespace hierarchy?  
> I don't have my own domain (and don't need one), and even though I  
> could have it hosted somewhere (such as SourceForge), it doesn't look  
> like a good idea to have the package name depend on a hosting site  
> that might not be forever. How do others approach this problem?
>
> Konrad.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to