registry-0.1.2.2: data structure for assembling components

Safe HaskellNone
LanguageHaskell2010

Data.Registry.Internal.Types

Description

List of types used inside the Registry

Synopsis

Documentation

data Value Source #

A Value is the Dynamic representation of a Haskell value + its description It is either provided by the user of the Registry or created as part of the resolution algorithm

Instances
Show Value Source # 
Instance details

Defined in Data.Registry.Internal.Types

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

getValueDynamic :: Value -> Dynamic Source #

Return the dynamic part of a value

data ValueDescription Source #

Description of a value. It might just have a description for its type when it is a value created by the resolution algorithm

describeValue :: (Typeable a, Show a) => a -> ValueDescription Source #

Describe a value with its type and actual content

describeTypeableValue :: Typeable a => a -> ValueDescription Source #

Describe a value with only its type

showValue :: Value -> Text Source #

Show a Value from the Registry

createValue :: (Show a, Typeable a) => a -> Value Source #

Create a Value from a Haskell value, with its Show description

createTypeableValue :: Typeable a => a -> Value Source #

Create a Value from a Haskell value, with only its Typeable description

createDynValue :: Dynamic -> Text -> Value Source #

Create a Value from a Dynamic value and some description

valueDynTypeRep :: Value -> SomeTypeRep Source #

Type representation of a Value

valueDyn :: Value -> Dynamic Source #

Dynamic representation of a Value

valDescription :: Value -> ValueDescription Source #

The description for a Value

valDescriptionToText :: ValueDescription -> Text Source #

A ValueDescription as Text. If the actual content of the Value is provided display the type first then the content

data Function Source #

A Function is the Dynamic representation of a Haskell function + its description

Instances
Show Function Source # 
Instance details

Defined in Data.Registry.Internal.Types

createFunction :: Typeable a => a -> Function Source #

Create a Function value from a Haskell function

describeFunction :: Typeable a => a -> FunctionDescription Source #

Describe a Function (which doesn't have a Show instance) that can be put in the Registry

showFunction :: Function -> Text Source #

Show a Function as Text using its Description

funDyn :: Function -> Dynamic Source #

Dynamic representation of a Function

funDynTypeRep :: Function -> SomeTypeRep Source #

Type representation of a Function

hasParameters :: Function -> Bool Source #

Return True if a Function has some input parameters

data Typed a Source #

A Typed value or function can be added to a Registry It is either a value, having both Show and Typeable information or a function having just Typeable information

newtype Functions Source #

This is a list of functions (or "constructors") available for constructing values

Constructors

Functions [Function] 

describeFunctions :: Functions -> Text Source #

Display a list of constructors

addFunction :: Function -> Functions -> Functions Source #

Add one more Function to the list of Functions

newtype Values Source #

List of values available which can be used as parameters to constructors for building other values

Constructors

Values [Value] 
Instances
Show Values Source # 
Instance details

Defined in Data.Registry.Internal.Types

Semigroup Values Source # 
Instance details

Defined in Data.Registry.Internal.Types

Monoid Values Source # 
Instance details

Defined in Data.Registry.Internal.Types

describeValues :: Values -> Text Source #

Display a list of values

addValue :: Value -> Values -> Values Source #

Add one more Value to the list of Values

newtype Context Source #

The types of values that we are trying to build at a given moment of the resolution algorithm

Constructors

Context 

Fields

describeSpecializations :: Specializations -> Text Source #

Display a list of specializations for the Registry, just showing the context (a type) in which a value must be selected

newtype Modifiers Source #

List of functions modifying some values right after they have been built. This enables "tweaking" the creation process with slightly different results. Here SomeTypeRep is the target value type a and

Constructors

Modifiers [(SomeTypeRep, Function)] 

describeModifiers :: Modifiers -> Text Source #

Display a list of modifiers for the Registry, just showing the type of the modified value