ocap-io-0.1.1.0: Object capability based IO

Safe HaskellSafe
LanguageHaskell2010

OCap.IO

Description

Object capability based IO.

See https://github.com/zenhack/haskell-ocap/blob/master/README.md for an overview.

Synopsis

Documentation

data OCapIO a Source #

The OCapIO monad is like IO, except that it does not provide "ambient" authoirty -- in order to perform IO, you also need an IOKey.

Instances
Monad OCapIO Source # 
Instance details

Defined in OCap.IO

Methods

(>>=) :: OCapIO a -> (a -> OCapIO b) -> OCapIO b #

(>>) :: OCapIO a -> OCapIO b -> OCapIO b #

return :: a -> OCapIO a #

fail :: String -> OCapIO a #

Functor OCapIO Source # 
Instance details

Defined in OCap.IO

Methods

fmap :: (a -> b) -> OCapIO a -> OCapIO b #

(<$) :: a -> OCapIO b -> OCapIO a #

Applicative OCapIO Source # 
Instance details

Defined in OCap.IO

Methods

pure :: a -> OCapIO a #

(<*>) :: OCapIO (a -> b) -> OCapIO a -> OCapIO b #

liftA2 :: (a -> b -> c) -> OCapIO a -> OCapIO b -> OCapIO c #

(*>) :: OCapIO a -> OCapIO b -> OCapIO b #

(<*) :: OCapIO a -> OCapIO b -> OCapIO a #

Semigroup a => Semigroup (OCapIO a) Source # 
Instance details

Defined in OCap.IO

Methods

(<>) :: OCapIO a -> OCapIO a -> OCapIO a #

sconcat :: NonEmpty (OCapIO a) -> OCapIO a #

stimes :: Integral b => b -> OCapIO a -> OCapIO a #

Monoid a => Monoid (OCapIO a) Source # 
Instance details

Defined in OCap.IO

Methods

mempty :: OCapIO a #

mappend :: OCapIO a -> OCapIO a -> OCapIO a #

mconcat :: [OCapIO a] -> OCapIO a #

data IOKey Source #

An IOKey is the most powerful object capability -- it lets you run arbitrary IO inside OCapIO. Get one of these with getIOKey and attenuate it with more specific & limited APIs.

getIOKey :: IO IOKey Source #

Gets an IOKey, which can later be used to perform IO actions inside the OCapIO monad.

runOCap :: OCapIO a -> IO a Source #

Run an OCapIO action.

runIO :: IO a -> IOKey -> OCapIO a Source #

Run an IO action inside of CapIO.