little-rio-3.0.0: When you need just the RIO monad
Safe HaskellSafe-Inferred
LanguageHaskell2010

LittleRIO

Description

Most definitions follow the RIO lib: https://hackage.haskell.org/package/rio-0.1.22.0/docs/RIO.html The rest follow from orphans: https://hackage.haskell.org/package/rio-orphans-0.1.2.0/docs/RIO-Orphans.html See LICENSE info in the README.

Documentation

newtype RIO env a Source #

Constructors

RIO 

Fields

Instances

Instances details
MonadReader env (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

ask :: RIO env env #

local :: (env -> env) -> RIO env a -> RIO env a #

reader :: (env -> a) -> RIO env a #

HasStateRef st env => MonadState st (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

get :: RIO env st #

put :: st -> RIO env () #

state :: (st -> (a, st)) -> RIO env a #

(Monoid w, HasWriteRef w env) => MonadWriter w (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

writer :: (a, w) -> RIO env a #

tell :: w -> RIO env () #

listen :: RIO env a -> RIO env (a, w) #

pass :: RIO env (a, w -> w) -> RIO env a #

MonadFail (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

fail :: String -> RIO env a #

MonadIO (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

liftIO :: IO a -> RIO env a #

Applicative (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

pure :: a -> RIO env a #

(<*>) :: RIO env (a -> b) -> RIO env a -> RIO env b #

liftA2 :: (a -> b -> c) -> RIO env a -> RIO env b -> RIO env c #

(*>) :: RIO env a -> RIO env b -> RIO env b #

(<*) :: RIO env a -> RIO env b -> RIO env a #

Functor (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

fmap :: (a -> b) -> RIO env a -> RIO env b #

(<$) :: a -> RIO env b -> RIO env a #

Monad (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

(>>=) :: RIO env a -> (a -> RIO env b) -> RIO env b #

(>>) :: RIO env a -> RIO env b -> RIO env b #

return :: a -> RIO env a #

MonadCatch (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

catch :: (HasCallStack, Exception e) => RIO env a -> (e -> RIO env a) -> RIO env a #

MonadMask (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

mask :: HasCallStack => ((forall a. RIO env a -> RIO env a) -> RIO env b) -> RIO env b #

uninterruptibleMask :: HasCallStack => ((forall a. RIO env a -> RIO env a) -> RIO env b) -> RIO env b #

generalBracket :: HasCallStack => RIO env a -> (a -> ExitCase b -> RIO env c) -> (a -> RIO env b) -> RIO env (b, c) #

MonadThrow (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

throwM :: (HasCallStack, Exception e) => e -> RIO env a #

HasLogAction env => MonadLogger (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> RIO env () #

PrimMonad (RIO env) Source # 
Instance details

Defined in LittleRIO

Associated Types

type PrimState (RIO env) #

Methods

primitive :: (State# (PrimState (RIO env)) -> (# State# (PrimState (RIO env)), a #)) -> RIO env a #

HasResourceMap env => MonadResource (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

liftResourceT :: ResourceT IO a -> RIO env a #

MonadUnliftIO (RIO env) Source # 
Instance details

Defined in LittleRIO

Methods

withRunInIO :: ((forall a. RIO env a -> IO a) -> IO b) -> RIO env b #

Monoid a => Monoid (RIO env a) Source # 
Instance details

Defined in LittleRIO

Methods

mempty :: RIO env a #

mappend :: RIO env a -> RIO env a -> RIO env a #

mconcat :: [RIO env a] -> RIO env a #

Semigroup a => Semigroup (RIO env a) Source # 
Instance details

Defined in LittleRIO

Methods

(<>) :: RIO env a -> RIO env a -> RIO env a #

sconcat :: NonEmpty (RIO env a) -> RIO env a #

stimes :: Integral b => b -> RIO env a -> RIO env a #

type PrimState (RIO env) Source # 
Instance details

Defined in LittleRIO

type PrimState (RIO env) = PrimState IO

mapRIO :: (env -> env') -> RIO env' a -> RIO env a Source #

liftRIO :: (MonadIO m, MonadReader env m) => RIO env a -> m a Source #

unliftRIO :: MonadIO m => env -> m (UnliftIO (RIO env)) Source #

runRIO :: MonadIO m => env -> RIO env a -> m a Source #

data SomeRef a Source #

Constructors

SomeRef !(IO a) !(a -> IO ()) 

Instances

Instances details
HasStateRef a (SomeRef a) Source # 
Instance details

Defined in LittleRIO

HasWriteRef a (SomeRef a) Source # 
Instance details

Defined in LittleRIO

writeSomeRef :: MonadIO m => SomeRef a -> a -> m () Source #

modifySomeRef :: MonadIO m => SomeRef a -> (a -> a) -> m () Source #

newSomeRef :: MonadIO m => a -> m (SomeRef a) Source #

class HasStateRef st env | env -> st where Source #

Methods

stateRefL :: Lens' env (SomeRef st) Source #

Instances

Instances details
HasStateRef a (SomeRef a) Source # 
Instance details

Defined in LittleRIO

class HasWriteRef w env | env -> w where Source #

Methods

writeRefL :: Lens' env (SomeRef w) Source #

Instances

Instances details
HasWriteRef a (SomeRef a) Source # 
Instance details

Defined in LittleRIO

class HasResourceMap env where Source #

Instances

Instances details
HasResourceMap ResourceMap Source # 
Instance details

Defined in LittleRIO