polysemy-1.2.3.0: Higher-order, low-boilerplate, zero-cost free monads.

Safe HaskellNone
LanguageHaskell2010

Polysemy.Input

Contents

Synopsis

Effect

data Input i m a where Source #

An effect which can provide input to an application. Useful for dealing with streaming input.

Constructors

Input :: Input i m i 
Instances
type DefiningModule (Input :: k1 -> k2 -> k1 -> Type) Source # 
Instance details

Defined in Polysemy.Input

type DefiningModule (Input :: k1 -> k2 -> k1 -> Type) = "Polysemy.Input"

Actions

input :: forall i r. MemberWithError (Input i) r => Sem r i Source #

Interpretations

runInputConst :: i -> Sem (Input i ': r) a -> Sem r a Source #

Run an Input effect by always giving back the same value.

runInputList :: [i] -> Sem (Input (Maybe i) ': r) a -> Sem r a Source #

Run an Input effect by providing a different element of a list each time. Returns Nothing after the list is exhausted.

runInputSem :: forall i r a. Sem r i -> Sem (Input i ': r) a -> Sem r a Source #

Runs an Input effect by evaluating a monadic action for each request.