Copyright | (c) 2021 Xy Ren |
---|---|
License | BSD3 |
Maintainer | xy.r@outlook.com |
Stability | experimental |
Portability | non-portable (GHC only) |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Synopsis
- data Input i :: Effect where
- input :: Input i :> es => Eff es i
- inputs :: Input i :> es => (i -> i') -> Eff es i'
- runInputConst :: i -> Eff (Input i ': es) ~> Eff es
- inputToListState :: Eff (Input (Maybe i) ': es) ~> Eff (State [i] ': es)
- inputToReader :: Eff (Input i ': es) ~> Eff (Reader i ': es)
- runInputEff :: Eff es i -> Eff (Input i ': es) ~> Eff es
- mapInput :: Input i' :> es => (i' -> i) -> Eff (Input i ': es) ~> Eff es
- bindInput :: Input i' :> es => (i' -> Eff es i) -> Eff (Input i ': es) ~> Eff es
Effect
data Input i :: Effect where Source #
An effect that is capable of reading from some input source, such as an input stream.
Operations
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.
runInputEff :: Eff es i -> Eff (Input i ': es) ~> Eff es Source #
Run an Input
effect by performing a computation for each input request.