Calling a State Monad recursively from within a let-block, via runState?
Can I call a State Monad recursively from within a let-block, via `runState`, or is that going way out of bounds? -db
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@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.
participants (2)
-
David Banas -
Juan Casanova