[Haskell] ANNOUNCE: reference 0.1
Bas van Dijk
v.dijk.bas at gmail.com
Mon Sep 6 20:15:23 EDT 2010
On Mon, Sep 6, 2010 at 11:55 PM, Maciej Piechotka <uzytkownik2 at gmail.com> wrote:
> Reference is class which generalizes references and monads they exists
> in. It means that IORef, STRef and others can be accessed by common
> interface.
>
> Currently it is of form:
>
> class Reference r m where
>
> 1. There was a proposal to rename the class to MonadRef or
> MonadReference. IMHO it would imply m -> r functional dependency and
> therefore disallow the instances for both MVar IO and IORef IO
>
> 2. Should the functional dependencies or type famillies be introduced?
> Personally I don't think so as I would like to allow all of the
> following:
>
> - IORef IO
> - MVar IO
> - IORef (ContT IO)
> - MVar (ContT IO)
>
> Any feedback mostly welcome.
>
> Regards
> PS. Darcs repository will be available soon
>
> _______________________________________________
> Haskell mailing list
> Haskell at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
>
I've played with a somewhat similar idea:
darcs get http://code.haskell.org/~basvandijk/code/only-read-or-write-vars
API Docs + Hyperlinked source:
http://code.haskell.org/~basvandijk/code/only-read-or-write-vars/doc/html/only-read-or-write-vars/
This is not released (yet) because I'm unsure about the design.
Especially, I'm unsure whether parameterizing Readable with α is a good idea:
class Readable v m α | v → m where read ∷ v → m α
and whether parameterizing Writable with α and β is a good idea:
class Writable v α m β | v → m where write ∷ v → α → m β
They do allow some
Regards,
Bas
More information about the Libraries
mailing list