Spl*_*aos 2 monads haskell state-monad
http://hackage.haskell.org/packages/archive/mtl/1.1.0.2/doc/html/src/Control-Monad-State-Lazy.html
instance (Monad m) => MonadState s (StateT s m) where
get = StateT $ \s -> return (s, s)
put s = StateT $ \_ -> return ((), s)
Run Code Online (Sandbox Code Playgroud)
()在put的定义中做了什么?
| 归档时间: |
|
| 查看次数: |
186 次 |
| 最近记录: |