| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Indigo.Common.SIS
Description
SomeIndigoState existential and utilities to work with it.
Synopsis
- newtype SomeIndigoState inp = SomeIndigoState {
- unSIS :: MetaData inp -> SomeGenCode inp
- data SomeGenCode inp where
- SomeGenCode :: GenCode inp out -> SomeGenCode inp
- toSIS :: IndigoState inp out -> SomeIndigoState inp
- runSIS :: SomeIndigoState inp -> MetaData inp -> (forall out. GenCode inp out -> r) -> r
- thenSIS :: SomeIndigoState inp -> (forall out. SomeIndigoState out) -> SomeIndigoState inp
- overSIS :: (forall out. GenCode inp out -> SomeGenCode inp) -> SomeIndigoState inp -> SomeIndigoState inp
Documentation
newtype SomeIndigoState inp Source #
IndigoState with hidden output stack, necessary to generate typed Lorentz code from untyped Indigo frontend.
Constructors
| SomeIndigoState | |
Fields
| |
data SomeGenCode inp where Source #
GenCode with hidden output stack
Constructors
| SomeGenCode :: GenCode inp out -> SomeGenCode inp |
toSIS :: IndigoState inp out -> SomeIndigoState inp Source #
Convert IndigoState to SomeIndigoState
runSIS :: SomeIndigoState inp -> MetaData inp -> (forall out. GenCode inp out -> r) -> r Source #
To run SomeIndigoState you need to pass an handler of GenCode with any output stack and initial MetaData.
thenSIS :: SomeIndigoState inp -> (forall out. SomeIndigoState out) -> SomeIndigoState inp Source #
Similar to a >> for SomeIndigoState.
overSIS :: (forall out. GenCode inp out -> SomeGenCode inp) -> SomeIndigoState inp -> SomeIndigoState inp Source #
Modify the GenCode inside a SomeIndigoState by passing an handler of GenCode that returns a SomeGenCode. Useful in some cases to "wrap" or update and exising SomeGenCode.