MonadRef class or the like?

Hal Daume III hdaume@ISI.EDU
Wed, 18 Sep 2002 15:22:38 -0700 (PDT)


Ah yes, I now remember this thread.  (How could I forget John's
emphatic "No, no, no!"s?  There doesn't seem to be any resolution to it,
though, at least in the archives.  It seemed mostly to be a conversation
between John and Ashley, with Simon chiming in once in a while.  As best I
can tell, the final state of the discussion was:

Simon: proposes having two RefMonads, one with only two instance (for IO
and for ST) and one with user-definable instances.  Definately wants some
sort of generalization.  Also proposes the "Ref IO a"/"Ref (ST
s) a" dichotemy.

John: Wants the RefMonad with the fun dep because it's more general than
Simon's; primarily because users cannot write new instances of Simon's
RefMonad (the only two instances will be for IO and ST and these will be
built in).  DOesn't like Simon's dichotemy because it breaks existing code
with explicit type sigs.

Ashley: Proposes:
  data Ref m a = MkRef { get :: m a, set :: a -> m () }
  class RefMonad m where { newRef :: a -> m (Ref m a) }
wants to ensure (like John) that it is easy to move these things across
lifted monads.

Did anything ever get resolved about this?  A quick and dirty grep through
the documentation doesn't turn up any RefMonad stuff.

 - Hal

--
Hal Daume III

 "Computer science is no more about computers    | hdaume@isi.edu
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume

On Thu, 19 Sep 2002, Tom Pledger wrote:

> Hal Daume III writes:
>  :
>  | [1] i'm thinking of something like:
>  | 
>  | class MonadRef m r | m -> r, r -> m where
>  |   newRef :: a -> m (r a)
>  |   readRef :: r a -> m a
>  |   writeRef :: r a -> a -> m ()
>  |   updateRef :: (a -> a) -> r a -> m ()
> 
> This bears some resemblance to a lively thread back in February.
> Here's how it started:
> 
>     http://haskell.cs.yale.edu/pipermail/haskell/2002-February/008842.html
> _______________________________________________
> Libraries mailing list
> Libraries@haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>