Functor instance for arbitrary polymorphic types

2003-06-10 Thread Graham Klyne
I've been running into a problem where I'd like to modify a container type based on a body of existing code to be a Functor. A difficulty seems to be that parts of the container type are based on a type constructor where the underlying type 'a' over which "fmap :: (a->b) -> t a -> t b" would op

Re: Typesafe MRef with a regular monad

2003-06-10 Thread Derek Elkins
On Tue, 10 Jun 2003 11:44:45 -0700 (PDT) [EMAIL PROTECTED] wrote: > > > update :: (Typable b) => FM k -> Key k a -> b -> (FM ...) > > I didn't know constraints on values are allowed... Given below is the > implementation of the required interface, in Haskell98 They aren't presumably as that wo

Re: ANN: H98 FFI Addendum 1.0, Release Candidate 10

2003-06-10 Thread John Hughes
> > > > - Great care should be exercised in the use of this function. Not only > > > - because of the danger of introducing side effects, but also because > > > - \code{unsafePerformIO} may compromise typing, for example, when it is used > > > - in conjunction with polymorphic references. > > > >

Re: Typesafe MRef with a regular monad

2003-06-10 Thread oleg
> update :: (Typable b) => FM k -> Key k a -> b -> (FM ...) I didn't know constraints on values are allowed... Given below is the implementation of the required interface, in Haskell98 module TypedFM where data FM k -- Abstract; finite map indexed bykeys of type k data Ke