Combining IO and state monads

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


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 
...".
]]

(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 ?

#g


-------------------
Graham Klyne
<GK@NineByNine.org>
PGP: 0FAA 69FF C083 000B A2E9  A131 01B9 1C7A DBCA CB5E