[Haskell-cafe] state monad transformer that adds or combines state

Vanessa McHale vanessa.mchale at iohk.io
Tue May 15 21:33:06 UTC 2018


You can apply StateT to an existing monad, e.g. StateT StateType (Either
ErrorType). Then 'get' and 'put' can be used inside this monad.


On 05/15/2018 04:29 PM, Dennis Raddle wrote:
> I'm not sure what happens if I apply a StateT to an existing State or
> StateT monad. Not sure how 'get' and 'put' would function, or if I
> would need to lift get and put to choose which state to access.
>
> D
>
> On Tue, May 15, 2018 at 12:49 AM, Francesco Ariis <fa-ml at ariis.it
> <mailto:fa-ml at ariis.it>> wrote:
>
>     On Mon, May 14, 2018 at 10:27:19PM -0700, Dennis Raddle wrote:
>     > In local computations, I may want to use some additional state.
>     Is there a
>     > way to add a little extra state temporarily?
>
>     Would StateT work (in general, taking advantage of what transformers
>     have to offer)?
>     _______________________________________________
>     Haskell-Cafe mailing list
>     To (un)subscribe, modify options or view archives go to:
>     http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>     <http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe>
>     Only members subscribed via the mailman list are allowed to post.
>
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180515/ca909320/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180515/ca909320/attachment.sig>


More information about the Haskell-Cafe mailing list