Combining IO and state monads

Derek Elkins ddarius@hotpop.com
Mon, 19 May 2003 14:39:15 -0400


On Mon, 19 May 2003 11:45:47 +0100
Graham Klyne <gk@ninebynine.org> wrote:

> At 17:54 18/05/03 -0400, Derek Elkins wrote:
> > > What does the vertical bar "|" in the class declaration mean?  I
> > > can't find this use mentioned in the Haskell report or the GHC
> > > type system extensions.
> 
> >It's mentioned in GHC's type extensions, but only as a reference to a
> >paper.  The '| m -> s' is a functional dependency.
> 
> OK, got it, thanks to everyone for help and suggestions.
> 
> Here are a couple of small notes/suggestions for the community's 
> consideration (pending more complete documentation):
> 
> (1) It may help if the brief section in the GHC libraries pages hinted
> at the syntax.  That would have helped me to identify the usage.  e.g.
> add something like this to 
> http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#FUNCTIONAL-DEPENDENCIES
> [[
> Functional dependencies are introduced by a vertical bar in the syntax
> of a class declaration;  e.g. "class (Monad m) => MonadState s m | m
> -> s where ...".
> ]]

I'd like documentation on the syntax at all as implemented.  I don't
remember the paper being to clear about more involved cases.

> (2) I note that the wiki page at http://haskell.org/hawiki/FunDeps
> mentions Mark Jones paper thus "See the paper[1] by Mark P. Jones",
> but I see no actual reference for the citation [1].  I guess it's the
> same as that referenced by the GHC user guide, i.e. 
> http://www.cse.ogi.edu/~mpj/pubs/fundeps.html ?

Old style links like that were lost when the Haskell Wiki was updated,
just fix things like that as you come across them.