HaskellCNOrg / haskellcn

home page
http://www.haskellcn.org
BSD 3-Clause "New" or "Revised" License
76 stars 4 forks source link

求助一个语法问题,class (Monad m) => MonadState s m | m -> s where ... by pwq1989 #113

Closed freizl closed 2 years ago

freizl commented 6 years ago

class (Monad m) => MonadState s m | m -> s where ... 额。。。这个 | m -> s 是啥语法啊

freizl commented 6 years ago

关键字 Functional dependencies

http://www.haskell.org/haskellwiki/Functional_dependencies

freizl commented 6 years ago

函数式依赖。functional dependencies。因为有些函数只用到m,这时候s就是不确定的。加上依赖之后,就可以确定了。具体参考wuhaisheng的链接