2 ms·
Wild guess, this is monadic style friendly right ? threading implicit variables (rng, etc) is often used in tutorials.
by agumonkey 10y ago
Wild guess, this is monadic style friendly right ? threading implicit variables (rng, etc) is often used in tutorials.
- theseoafs 10y agoYep -- actually, if you look at how the IO type is defined in Haskell, it looks basically like this (there is an object that represents the "state of the world" that gets threaded through computations).
- agumonkey 10y agoAlright. One distinction though is that vanilla IO monad has no logical constraint on consumption. You could technically thread a resource through a function many times and Haskell wouldn't complain. (This is blurry but I had something clear in mind, someone at a Haskeel meetup showed how to enforce constraints on monads through some kind of Phantom Type trick)