On 21 Nov 2009, at 06:31, samppi wrote:
> And no matter what I do, I can't fulfill that second axiom. Has anyone
> created this type of monad before? It seems like it should be a common
> pattern: exactly like (state-t maybe-m), only failures are vector
> pairs too.
One problem I see in your question is the little word "too". A normal
value in the monad (state-t maybe-m) is of the form (fn [state] ...).
This is not a vector pair, it's a function.
I am not familiar enough with parsing to understand *why* you want
failures represented as vector pairs. It might help you to read the
description of Parsec, an elaborate monadic parsing library in Haskell:
http://legacy.cs.uu.nl/daan/download/papers/parsec-paper.pdf
It discusses many "real-world" issues that are usually left out of
academic papers on monadic parsing. Perhaps your problem is addressed
there as well.
Konrad.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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