
On Mon, 2010-09-06 at 10:40 +0200, Martijn van Steenbergen wrote:
On 8/28/10 1:48, Maciej Piechotka wrote:
Iteratee-parsec is a library which allows to have a parsec (3) parser in Iteratee monad.
It contains 2 implementations: - John Lato's on public domain. It is based on monoid and design with short parsers in mind. - Mine on MIT. It is based on single-linked mutable list. It seems to be significantly faster for larger parsers - at least in some cases - but it requires a monad with references (such as for example IO or ST).
Your Reference class is very useful on its own. Do you think you could move it to a separate package?
It's noted in comment ;) As requested I'll upload it today.
And perhaps rename it class MonadReference (or MonadRef), similar to other monad type classes.
Hmm. The problem is that it is more about reference then monad. If I would use any functional dependencies it would be: class Reference r m | r -> m where ... if any type families then: class Monad (ReferenceMonad r) => Reference r where type ReferenceMonad r :: * -> * ... The reverse does not apply as: instance Reference IORef IO instance Reference MVar IO I don't thing MonadReference/MonadRef is good name (I'll push reference package with old name - possibly renaming it later).
Martijn.
Regards