cleff-0.3.2.0: Fast and concise extensible effects
Copyright(c) 2021 Xy Ren
LicenseBSD3
Maintainerxy.r@outlook.com
Stabilityexperimental
Portabilitynon-portable (GHC only)
Safe HaskellTrustworthy
LanguageHaskell2010

Cleff.Input

Description

 
Synopsis

Effect

data Input i :: Effect where Source #

An effect that is capable of reading from some input source, such as an input stream.

Constructors

Input :: Input i m i 

Operations

input :: Input i :> es => Eff es i Source #

Read an input value from an input source.

inputs :: Input i :> es => (i -> i') -> Eff es i' Source #

Apply a function to the result of input.

Interpretations

runInputConst :: i -> Eff (Input i ': es) ~> Eff es Source #

Run an Input effect by giving a constant input value.

inputToListState :: Eff (Input (Maybe i) ': es) ~> Eff (State [i] ': es) Source #

Run an Input effect by going through a list of values.

inputToReader :: Eff (Input i ': es) ~> Eff (Reader i ': es) Source #

Run an Input in terms of a Reader.

Since: 0.2.1.0

runInputEff :: Eff es i -> Eff (Input i ': es) ~> Eff es Source #

Run an Input effect by performing a computation for each input request.

mapInput :: Input i' :> es => (i' -> i) -> Eff (Input i ': es) ~> Eff es Source #

Transform an Input effect into another one already in the effect stack, by a pure function.

Since: 0.2.1.0

bindInput :: Input i' :> es => (i' -> Eff es i) -> Eff (Input i ': es) ~> Eff es Source #

Transform an Input effect into another one already in the effect stack, by an effectful computation.

Since: 0.2.1.0