类定义中的管道是什么意思?

时间:2022-04-11 17:37:54
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.

上面的管道是什么意思?片段来自这里。

1 个解决方案

#1


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

实际上,这是一种“功能依赖”。在这种情况下,这意味着m唯一地标识w - 类型m确定类型w。 (这可能是一个更好的链接。)

#1


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

实际上,这是一种“功能依赖”。在这种情况下,这意味着m唯一地标识w - 类型m确定类型w。 (这可能是一个更好的链接。)