Copyright | (C) 2017 Jacob Stanley |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Stevan Andjelkovic <stevan.andjelkovic@strath.ac.uk> |
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 from the Hedgehog library.
Synopsis
- newtype Environment = Environment {}
- data EnvironmentError
- emptyEnvironment :: Environment
- insertConcrete :: Var -> Dynamic -> Environment -> Environment
- insertConcretes :: [Var] -> [Dynamic] -> Environment -> Environment
- reifyDynamic :: forall a. Typeable a => Dynamic -> Either EnvironmentError (Concrete a)
- reifyEnvironment :: Environment -> forall a. Symbolic a -> Either EnvironmentError (Concrete a)
- reify :: Traversable t => Environment -> t Symbolic -> Either EnvironmentError (t Concrete)
Documentation
newtype Environment Source #
A mapping of symbolic values to concrete values.
Instances
Show Environment Source # | |
Defined in Test.StateMachine.Types.Environment showsPrec :: Int -> Environment -> ShowS # show :: Environment -> String # showList :: [Environment] -> ShowS # | |
Semigroup Environment Source # | |
Defined in Test.StateMachine.Types.Environment (<>) :: Environment -> Environment -> Environment # sconcat :: NonEmpty Environment -> Environment # stimes :: Integral b => b -> Environment -> Environment # | |
Monoid Environment Source # | |
Defined in Test.StateMachine.Types.Environment mempty :: Environment # mappend :: Environment -> Environment -> Environment # mconcat :: [Environment] -> Environment # |
data EnvironmentError Source #
Environment errors.
Instances
Eq EnvironmentError Source # | |
Defined in Test.StateMachine.Types.Environment (==) :: EnvironmentError -> EnvironmentError -> Bool # (/=) :: EnvironmentError -> EnvironmentError -> Bool # | |
Ord EnvironmentError Source # | |
Defined in Test.StateMachine.Types.Environment compare :: EnvironmentError -> EnvironmentError -> Ordering # (<) :: EnvironmentError -> EnvironmentError -> Bool # (<=) :: EnvironmentError -> EnvironmentError -> Bool # (>) :: EnvironmentError -> EnvironmentError -> Bool # (>=) :: EnvironmentError -> EnvironmentError -> Bool # max :: EnvironmentError -> EnvironmentError -> EnvironmentError # min :: EnvironmentError -> EnvironmentError -> EnvironmentError # | |
Show EnvironmentError Source # | |
Defined in Test.StateMachine.Types.Environment showsPrec :: Int -> EnvironmentError -> ShowS # show :: EnvironmentError -> String # showList :: [EnvironmentError] -> ShowS # |
emptyEnvironment :: Environment Source #
Create an empty environment.
insertConcrete :: Var -> Dynamic -> Environment -> Environment Source #
Insert a symbolic / concrete pairing in to the environment.
insertConcretes :: [Var] -> [Dynamic] -> Environment -> Environment Source #
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 :: Traversable t => Environment -> t Symbolic -> Either EnvironmentError (t Concrete) Source #
Convert a symbolic structure to a concrete one, using the provided environment.