3 ms·
In Haskell there is the ST monad can be used to write stateful implementations for pure functions. The type system guarantees that side effects can't escape the
by ufo 14y ago
In Haskell there is the ST monad can be used to write stateful implementations for pure functions. The type system guarantees that side effects can't escape their scope.
http://www.haskell.org/haskellwiki/Monad/ST http://www.haskell.org/haskellwiki/Monad/ST
- worldsayshi 14y agoAlthough this is great information I primarily had 'less pure' languages' in mind when I asked. Come to think of it, restricting mutable access to only the relevant objects as per function call using const seems to allow just this! A function having only const input and output "should be" free of side effects (if no global mutables); while still being allowed to run all manner of unpure processes local to its own calling context.