registry-0.1.2.2: data structure for assembling components

Safe HaskellNone
LanguageHaskell2010

Data.Registry.Internal.Registry

Description

Internal structure of a Registry and associated functions

Synopsis

Documentation

findValue :: SomeTypeRep -> Context -> Specializations -> Values -> Maybe Value Source #

Find a value having a target type from: - a list of "preferred values" (Specializations) to select when we are trying to find the targe in a specific context (Context). Context describes the types of values we are currently trying to (recursively) make

  • a list of dynamic values (Values)

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