Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p251 StateT单子转换 #39

Open
boboyada opened this issue Mar 17, 2017 · 1 comment
Open

p251 StateT单子转换 #39

boboyada opened this issue Mar 17, 2017 · 1 comment

Comments

@boboyada
Copy link

第2段文字
这也反映了单子变换的一个特点:单子变换可以隔离不同层次的操作,底层的单子上下文和外层的可以互相隔离。?
能否再就书上这几个例子,就前面这段话再阐明一下?

@winterland1989
Copy link
Owner

winterland1989 commented Mar 22, 2017

这段话的意思主要体现在 lift :: (Monad m, MonadTrans t) => m a -> t m a 这个函数上,比如说我们有一个StateT s1 (StateT s2 IO) Int 的值,那么 modifylift . modify 操作的分别是 s1s2 类型的状态。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants