Modulelinear-base-0.4.0Haskell2010
System.IO.Resource.Linear.Internal
- 5 types
- 19 values
- Packagelinear-base-0.4.0
- Exports24
- LanguageHaskell2010
- LicenceMIT
- SourceInternal.hs
The resource-aware I/O monad. This monad guarantees that acquired resources are always released.
Instances7Monad, Functor, Applicative, Monoid, Semigroup, …
Applicative RIODefined in linear-base-0.4.0 · System.IO.Resource.Linear.InternalFunctor RIODefined in linear-base-0.4.0 · System.IO.Resource.Linear.InternalMonad RIODefined in linear-base-0.4.0 · System.IO.Resource.Linear.InternalFunctor RIODefined in linear-base-0.4.0 · System.IO.Resource.Linear.InternalApplicative RIODefined in linear-base-0.4.0 · System.IO.Resource.Linear.InternalMonoid a => Monoid (RIO a)Defined in linear-base-0.4.0 · System.IO.Resource.Linear.InternalSemigroup a => Semigroup (RIO a)Defined in linear-base-0.4.0 · System.IO.Resource.Linear.Internal
Take a RIO computation with a value a that is not linearly bound and
make it a System.IO computation.
Should not be applied to a function that acquires or releases resources.
See System.IO.System.IO.openFile
See System.IO.System.IO.openBinaryFile
Specialised alias for release
See System.IO..System.IO.hSeek
See System.IO..System.IO.hTell
Deprecated. UnsafeResource has been renamed to Resource
Deprecated alias for Resource
release r calls the release function provided when r was acquired.
Deprecated. unsafeRelease has been renamed to release
Deprecated alias of the release function
Given a resource in the System.IO.Linear.IO monad, and
given a function to release that resource, provides that resource in
the RIO monad. For example, releasing a Handle from System.IO
would be done with fromSystemIO hClose. Because this release function
is an input, and could be wrong, this function is unsafe.
Given a System.IO computation on an unsafe resource,
lift it to RIO computaton on the acquired resource.
That is function of type a -> IO b turns into a function of type
Resource a %1-> RIO (Ur b)
along with threading the Resource a.
unsafeFromSystemIOResource is only safe to use on actions which do not release the resource.
Note that the result b can be used non-linearly.
Specialised variant of unsafeFromSystemIOResource for actions that don't return a value.