Konrad,

As long as your breaking things in monads, what would you think of
changing m-seq to this.

(defmonadfn m-seq
  "'Executes' the monadic values in ms and returns a sequence of the
   basic values contained in them."
  [& ms]
  (reduce (fn [q p]
                          (m-bind p (fn [x]
                                                        (m-bind q (fn [y]
                                                                                
  (m-result (cons x y)))) )))
                  (m-result '())
                  (reverse ms)))

so that it doesn't accept a list of monadic values but instead lets
you call it with any number of mv's.

Instead of:

(m-seq [mv1 mv2 mv3])

you would write

(m-seq mv1 mv2 mv3)

That would make it be the same as the implementations of m-plus you've
already done.

Thanks

On Feb 19, 1:45 am, Konrad Hinsen <konrad.hin...@laposte.net> wrote:
> On 18.02.2009, at 22:40, jim wrote:
>
> > Here's an updated state-m monad transformer.  I dropped my CA in the
> > mail today.  I figure if I post a snippet of code to the list, it's
> > public domain, so do with it as you wish.  Or wait till Rich gets my
> > CA.
>
> Thanks!  It's in my working copy of themonadslibrary module  
> already, and I will check it in when I see your name on the  
> contributors' list. I'll be absent for a few days anyway, so it  
> hardly makes a difference.
>
> 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 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to