Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internal structure of a Registry
and
associated functions
Synopsis
- findValue :: SomeTypeRep -> Context -> Specializations -> Values -> Maybe Value
- findConstructor :: SomeTypeRep -> Functions -> Maybe Function
- storeValue :: Modifiers -> Value -> Stack Value
Documentation
findValue :: SomeTypeRep -> Context -> Specializations -> Values -> Maybe Value Source #
Find a value having a target type from a list of dynamic values found in a list of constructors where some of them are not functions There is also a list of specializations when we can specialize the values to use if a given type is part of the context
findConstructor :: SomeTypeRep -> Functions -> Maybe Function Source #
Find a constructor function returning a target type from a list of constructors
storeValue :: Modifiers -> Value -> Stack Value Source #
Given a newly built value, check if there are modifiers for that
value and apply them before "storing" the value which means
adding it on top of the registry, represented by the Values
state
in StateT Values.
We use a StateT Either because applying modifiers could fail and we want
to catch and report the error. Note that this error would be an implementation
error (and not a user error) since at the type-level everything should be correct