registry-0.6.0.0: data structure for assembling components
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Registry.Internal.Make

Description

Untyped implementation of the functionalities in Make

Synopsis

WARNING: HIGHLY UNTYPED IMPLEMENTATION !

makeUntyped :: SomeTypeRep -> Context -> Entries -> Specializations -> Modifiers -> Stack (Maybe Value) Source #

Make a value from a desired output type represented by SomeTypeRep and a list of possible constructors A Context is passed in the form of a stack of the types we are trying to build so far Entries is the list of all the constructors in the Registry Specializations is a list of specific values to use in a given context, overriding the normal search Modifiers is a list of functions to apply right before a value is stored in the Registry

showContextTargets :: Context -> [Text] Source #

Show the target type and possibly the constructor function requiring it for every target type in the context

makeInputs Source #

Arguments

:: Function 
-> [SomeTypeRep]

input types to build

-> Context

current context of types being built

-> Entries

available entries to build values

-> Specializations

list of values to use when in a specific context

-> Modifiers

modifiers to apply before storing made values

-> Stack [Value] 

Make the input values of a given function When a value has been made it is placed on top of the existing registry so that it is memoized if needed in subsequent calls