This is the linear IO monad.
It is a newtype around a function that transitions from one
State# RealWorld to another, producing a value of type a along with it.
The State# RealWorld is the state of the world/machine outside the program.
The only way, such a computation is run is by putting it in Main.main
somewhere.
Note that this is the same definition as the standard IO monad, but with a linear arrow enforcing the implicit invariant that IO actions linearly thread the state of the real world. Hence, we can safely release the constructor to this newtype.
Instances8Monad, Functor, Applicative, MonadIO, Monoid, Semigroup, …
Applicative IODefined in linear-base-0.4.0 · System.IO.LinearFunctor IODefined in linear-base-0.4.0 · System.IO.LinearMonad IODefined in linear-base-0.4.0 · System.IO.LinearFunctor IODefined in linear-base-0.4.0 · System.IO.LinearApplicative IODefined in linear-base-0.4.0 · System.IO.LinearMonadIO IODefined in linear-base-0.4.0 · Control.Monad.IO.Class.LinearMonoid a => Monoid (IO a)Defined in linear-base-0.4.0 · System.IO.LinearSemigroup a => Semigroup (IO a)Defined in linear-base-0.4.0 · System.IO.Linear