Is it possible to do the IO monad from Haskell in Clojure? -
I have looked at more documentation. I have read more through the Moned blog entries.
The closest I can get - but this does not apply to the 'Monad interface' (for a better phrasing wish) does not appear
This is the use of ST in Hassel The example is
oneST :: STs int - note that it works correctly for any one = = var var; & Lt; - Modify newSTRef 0stiff var (+1) readSTRef var one :: int one = runST oneST My question is: Is it possible to do this in closure? Can you provide an example?
yes -
There are a few ways to answer this question. Unfortunately: Think of IO as a Monod Transformer which gives special permission to work with side effects. Then there is no monad in the closure, an IO monad, because the display of side effects is not a privileged operation in the closure. -
Phatuan: Close Turing-Full, so that you can apply all hoccases including IO MonD in Clozer. Haskell Turing is full, so that you can apply all the closures in Haskell and expose the IO monad. no - philosopher: Integrating with IO monad, maintaining purity while integrating with type system , Is incompatible with the closure impairment and dynamic typing. Any attempt to make noise in the IO monad will be either obstructed with the view of the closure or failing to occupy the necessary point of being an IO monad.
Maybe -
Partially: The MonaDIC-OO-Stream Library which is linked to algo For use with .monands library, or its predecessor. Monadike Interface is the state mond. Monadic-O-Stream offers some gel Io MonaDeck functions to work with it. It does not prevent you from using any other function with side effects, and there is no way to say that without a type of system integrating IO, which is not what IO monod is; It just does a few things like Io Monad. It's interesting but of suspicious utility. -
Someday: It is interested if the side effects are added to the type system, then they are structured differently for some purposes To be desirable and IO can give reasons for the existence of something like Monaad in the typed closure.
Comments
Post a Comment