[Haskell-cafe] Calling a State Monad recursively from within a let-block, via runState?

Juan Casanova juan.casanova at ed.ac.uk
Fri Mar 13 23:00:42 UTC 2020


I do this relatively often. I see the State monad as a convenient way  
to see the type (s -> (a,s)) that happens to have a monad instance.  
When the best way to make use of it is to go in and out of monad  
"mode", I do that.

Quoting David Banas <capn.freako at gmail.com> on Fri, 13 Mar 2020  
15:56:55 -0700:

> Can I call a State Monad recursively from within a let-block, via  
> `runState`, or is that going way out of bounds?
> -db
>
> _______________________________________________
> 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.



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




More information about the Haskell-Cafe mailing list