Re: can't def m-bind because namespace

2010-09-09 Thread Nicolas Oury
Not really, but monad can be a bit tricky at first. Your first email was a namespace related problem, that has little to do with monads. But it can be better to start with other part of clojure and come back to monads later. They can be useful to refactor code or write a nicer program, but you c

Re: can't def m-bind because namespace

2010-09-08 Thread MohanR
So actually it looks like I need to understand type theory to understand this. Thanks, Mohan On Sep 7, 7:04 pm, Nicolas Oury wrote: > > ...and report your findings here or blog somewhere if you don't mind > > :) I've been reading a lot about monads lately and can't get my head > > around it yet

Re: can't def m-bind because namespace

2010-09-07 Thread Joop Kiefte
Monads are mostly used because they are necessary in Haskell. In Clojure the urgent need is not there. However, you can sure get some cleaner and/or more composable code if you use monads in your advantage. 2010/9/7 Jacek Laskowski : > On Tue, Sep 7, 2010 at 4:04 PM, Nicolas Oury wrote: > >> Hope

Re: can't def m-bind because namespace

2010-09-07 Thread Jacek Laskowski
On Tue, Sep 7, 2010 at 4:04 PM, Nicolas Oury wrote: > Hope that helps. It did. Thanks. Would you share some examples of its use in Clojure apps? I'd love seeing more examples where a monad-based solution is contrasted/compared to its more traditional, common approach. I wonder why monads are not

Re: can't def m-bind because namespace

2010-09-07 Thread Nicolas Oury
> ...and report your findings here or blog somewhere if you don't mind > :) I've been reading a lot about monads lately and can't get my head > around it yet so any help appreciated (I'm coming from Java and > Clojure is my first real functional language - that's why it causes > headaches, I believ

Re: can't def m-bind because namespace

2010-09-07 Thread Jacek Laskowski
On Tue, Sep 7, 2010 at 2:13 PM, MohanR wrote: > Maybe I should not read about monads first. ...and report your findings here or blog somewhere if you don't mind :) I've been reading a lot about monads lately and can't get my head around it yet so any help appreciated (I'm coming from Java and Cl

Re: can't def m-bind because namespace

2010-09-07 Thread Nicolas Oury
http://clojure.org/namespaces You should require clojure.contrib.monad and bot use it. (ns my-namespace (:require (clojure.contrib.monad :as m)) m/m-bind, for example. Then you can define your own m-bind without conflict with an existing one. On Tue, Sep 7, 2010 at 1:13 PM, MohanR wrote: > j