34
class (Monoid w, Monad m) => MonadWriter w m | m -> w where 
   pass   :: m (a,w -> w) -> m a 
   listen :: m a -> m (a,w) 
   tell   :: w -> m () 

What is the meaning of the pipe above? The snippet comes from here.

Volker Stolz
  • 7,274
  • 1
  • 32
  • 50
luntain
  • 4,560
  • 6
  • 37
  • 48
  • 1
    possible duplicate of [What's the "|" for in a Haskell class definition?](http://stackoverflow.com/questions/2675655/whats-the-for-in-a-haskell-class-definition) – Don Stewart Apr 19 '11 at 01:36

1 Answers1

28

Actually, it's a "functional dependency". In this case that means that m uniquely identifies w -- the type m determines the type w. (This may be a better link.)

luqui
  • 59,485
  • 12
  • 145
  • 204
Andrew Jaffe
  • 26,554
  • 4
  • 50
  • 59