polysemy-1.9.0.0: Higher-order, low-boilerplate free monads.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Input

Description

 
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

Get the next available message.

Actions

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

Get the next available message.

inputs :: forall i j r. Member (Input i) r => (i -> j) -> Sem r j Source #

Apply a function to an input, cf. asks

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.