I haven't played around with this but it looks as if the second argument to
bind needs to know what kind of monad it's operating in, is that right?
Would it be possible to write agnostic functions like this in this lib?

monads.core> (defn tst-reader [f]
               (mdo env <- ask
                    v <- (lift (f env))
                    (return (println "here I am"))
                    (return v)))
#'monads.core/tst-reader
monads.core> (require '[monads.reader :as r] '[monads.identity :as i]
'[monads.state :as st] '[monads.error :as e])
nil
monads.core> (r/run-reader-t (r/t i/m) (tst-reader (comp return inc)) 5)
here I am
6
monads.core> (r/run-reader-t (r/t e/m) (tst-reader (fn [_] (throw-error
"early exit"))) 5)
#<Either [:left early exit]>
monads.core> (st/run-state (r/run-reader-t (r/t st/m) (tst-reader (fn [env]
(>> (modify #(assoc % :env env)) (return (dec env))))) 5) {})
here I am
#<Pair [4 {:env 5}]>
monads.core>

?


On Tue, Jul 2, 2013 at 11:07 AM, Dragan Djuric <draga...@gmail.com> wrote:

> I am pleased to announce a first public release of new (and different)
> "monads and friends" library for Clojure.
> Extensive *documentation* is at http://fluokitten.uncomplicate.org
>
> Fluokitten is a Clojure library that implements category theory concepts,
> such as functors, applicative functors, monads, monoids etc. in idiomatic
> Clojure.
>
> Main project goals are:
>
>    - Fit well into idiomatic Clojure - Clojure programmers should be able
>    to use and understand Fluokitten like any regular Clojure library.
>    - Fit well into Haskell monadic types conventions - programmers should
>    be able to reuse existing widespread monadic programming know-how and
>    easily translate it to Clojure code.
>    - Be reasonably easy to learn - the code from the existing books,
>    articles and tutorials for learning monadic programming, which is usually
>    written in Haskell should be easily translatable to Clojure with 
> Fluokitten.
>    - Offer good performance.
>
> Please give us your feedback, and we would also love if anyone is willing
> to help, regardless of previous experience, so please *get involved*.
> There are lots of things to be improved:
>
>    - If you are a native English speaker, i would really appreciate if
>    you can help with correcting the English on the Fluokitten site and in the
>    documentation.
>    - Contribute your example code (your own or the ports from Haskell
>    tutorials) to be added to Fluokitten tests.
>    - Contribute articles and tutorials.
>    - Do code review of the Fluokitten code and suggest improvements.
>    - If you find bugs, report them via Fluokitten issue tracker.
>    - If you have any additional suggestion, contact us here:
>    http://fluokitten.uncomplicate.org/articles/community.html
>
>  --
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks, which
may be sweet, aromatic, fermented or spirit-based. ... Family and social
life also offer numerous other occasions to consume drinks for pleasure."
[Larousse, "Drink" entry]

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to