| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Registry.Internal.Types
Description
List of types used inside the Registry
Synopsis
- data Value
- getValueDynamic :: Value -> Dynamic
- data ValueDescription = ValueDescription {
- _valueType :: Text
- _valueValue :: Maybe Text
- describeValue :: (Typeable a, Show a) => a -> ValueDescription
- describeTypeableValue :: Typeable a => a -> ValueDescription
- showValue :: Value -> Text
- createValue :: (Show a, Typeable a) => a -> Value
- createTypeableValue :: Typeable a => a -> Value
- createDynValue :: Dynamic -> Text -> Value
- valueDynTypeRep :: Value -> SomeTypeRep
- valueDyn :: Value -> Dynamic
- valDescription :: Value -> ValueDescription
- valDescriptionToText :: ValueDescription -> Text
- data Function = Function Dynamic FunctionDescription
- createFunction :: Typeable a => a -> Function
- data FunctionDescription = FunctionDescription {
- _inputTypes :: [Text]
- _outputType :: Text
- describeFunction :: Typeable a => a -> FunctionDescription
- showFunction :: Function -> Text
- funDescription :: Function -> FunctionDescription
- funDyn :: Function -> Dynamic
- funDynTypeRep :: Function -> SomeTypeRep
- funDescriptionToText :: FunctionDescription -> Text
- hasParameters :: Function -> Bool
- data Typed a
- newtype Functions = Functions [Function]
- describeFunctions :: Functions -> Text
- addFunction :: Function -> Functions -> Functions
- newtype Values = Values [Value]
- describeValues :: Values -> Text
- addValue :: Value -> Values -> Values
- newtype Context = Context {
- _context :: [SomeTypeRep]
- newtype Specializations = Specializations [(SomeTypeRep, Value)]
- describeSpecializations :: Specializations -> Text
- newtype Modifiers = Modifiers [(SomeTypeRep, Function)]
- describeModifiers :: Modifiers -> Text
Documentation
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
Constructors
| ValueDescription | |
Fields
| |
Instances
| Eq ValueDescription Source # | |
Defined in Data.Registry.Internal.Types Methods (==) :: ValueDescription -> ValueDescription -> Bool # (/=) :: ValueDescription -> ValueDescription -> Bool # | |
| Show ValueDescription Source # | |
Defined in Data.Registry.Internal.Types Methods showsPrec :: Int -> ValueDescription -> ShowS # show :: ValueDescription -> String # showList :: [ValueDescription] -> ShowS # | |
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
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
valDescription :: Value -> ValueDescription Source #
The description for a Value
A Function is the Dynamic representation of a Haskell function + its description
Constructors
| Function Dynamic FunctionDescription |
createFunction :: Typeable a => a -> Function Source #
Create a Function value from a Haskell function
data FunctionDescription Source #
Description of a Function with input types and output type
Constructors
| FunctionDescription | |
Fields
| |
Instances
| Eq FunctionDescription Source # | |
Defined in Data.Registry.Internal.Types Methods (==) :: FunctionDescription -> FunctionDescription -> Bool # (/=) :: FunctionDescription -> FunctionDescription -> Bool # | |
| Show FunctionDescription Source # | |
Defined in Data.Registry.Internal.Types Methods showsPrec :: Int -> FunctionDescription -> ShowS # show :: FunctionDescription -> String # showList :: [FunctionDescription] -> ShowS # | |
describeFunction :: Typeable a => a -> FunctionDescription Source #
funDescription :: Function -> FunctionDescription Source #
The Description of a Function
funDynTypeRep :: Function -> SomeTypeRep Source #
Type representation of a Function
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
Constructors
| TypedValue Value | |
| TypedFunction Function |
This is a list of functions (or "constructors") available for constructing values
describeFunctions :: Functions -> Text Source #
Display a list of constructors
addFunction :: Function -> Functions -> Functions Source #
Add one more Function to the list of Functions
List of values available which can be used as parameters to constructors for building other values
describeValues :: Values -> Text Source #
Display a list of values
The types of values that we are trying to build at a given moment of the resolution algorithm
Constructors
| Context | |
Fields
| |
newtype Specializations Source #
Specification of values which become available for construction when a corresponding type comes in context
Constructors
| Specializations [(SomeTypeRep, Value)] |
Instances
| Show Specializations Source # | |
Defined in Data.Registry.Internal.Types Methods showsPrec :: Int -> Specializations -> ShowS # show :: Specializations -> String # showList :: [Specializations] -> ShowS # | |
| Semigroup Specializations Source # | |
Defined in Data.Registry.Internal.Types Methods (<>) :: Specializations -> Specializations -> Specializations # sconcat :: NonEmpty Specializations -> Specializations # stimes :: Integral b => b -> Specializations -> Specializations # | |
| Monoid Specializations Source # | |
Defined in Data.Registry.Internal.Types Methods mappend :: Specializations -> Specializations -> Specializations # mconcat :: [Specializations] -> Specializations # | |
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
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