3 ms·
I was playing with Haskell years ago and remembered a cheap trick. Just make a typeclass with all the IO ops you want and also make it a monad. You now have you
by quickthrower2 3y ago
I was playing with Haskell years ago and remembered a cheap trick. Just make a typeclass with all the IO ops you want and also make it a monad. You now have your own custom IO monad with only the bits you want to “give access to”. It is easier to understand than free
monads (which I never truly grokked but could happily copy/paste adapt and get em to work, sans understanding!)