Copyright | (C) 2017 Jacob Stanley |
---|---|

License | BSD-style (see the file LICENSE) |

Maintainer | Stevan Andjelkovic <stevan@advancedtelematic.com> |

Stability | provisional |

Portability | non-portable (GHC extensions) |

Safe Haskell | None |

Language | Haskell2010 |

This module contains environments that are used to translate between symbolic and concrete references. It's taken verbatim from the Hedgehog library.

- newtype Environment = Environment {}
- data EnvironmentError
- emptyEnvironment :: Environment
- insertConcrete :: Symbolic a -> Concrete a -> Environment -> Environment
- reifyDynamic :: forall a. Typeable a => Dynamic -> Either EnvironmentError (Concrete a)
- reifyEnvironment :: Environment -> forall a. Symbolic a -> Either EnvironmentError (Concrete a)
- reify :: HTraversable t => Environment -> t Symbolic b -> Either EnvironmentError (t Concrete b)

# Documentation

newtype Environment Source #

A mapping of symbolic values to concrete values.

data EnvironmentError Source #

Environment errors.

emptyEnvironment :: Environment Source #

Create an empty environment.

insertConcrete :: Symbolic a -> Concrete a -> Environment -> Environment Source #

Insert a symbolic / concrete pairing in to the environment.

reifyDynamic :: forall a. Typeable a => Dynamic -> Either EnvironmentError (Concrete a) Source #

Cast a `Dynamic`

in to a concrete value.

reifyEnvironment :: Environment -> forall a. Symbolic a -> Either EnvironmentError (Concrete a) Source #

Turns an environment in to a function for looking up a concrete value from a symbolic one.

reify :: HTraversable t => Environment -> t Symbolic b -> Either EnvironmentError (t Concrete b) Source #

Convert a symbolic structure to a concrete one, using the provided environment.