Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a pipe in a class definition mean?

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.

like image 311
luntain Avatar asked Jan 30 '09 22:01

luntain


1 Answers

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.)

like image 148
Andrew Jaffe Avatar answered Oct 22 '22 05:10

Andrew Jaffe