[Haskell-cafe] Usage of | in classes

Frank-Andre Riess riess at informatik.uni-muenchen.de
Tue Jun 7 09:54:06 EDT 2005


Gracjan's question led me to another question:

> class Monad m => Ref m r | m -> r where
>      newRef :: a -> m (r a)
>      readRef :: r a -> m a
>      writeRef :: r a -> a -> m ()

What's the meaning of the bar and the function type in this declaration. I've 
seen something like that before (with state monads, I think), but couldn't 
find an explanation in the Haskell grammar (or anywhere else on haskell.org).

Thanks in advance,

More information about the Haskell-Cafe mailing list