Safe Haskell | None |
---|---|
Language | Haskell2010 |
List of types used inside the Registry
Synopsis
- data Value
- 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]
- addFunction :: Function -> Functions -> Functions
- newtype Values = Values [Value]
- addValue :: Value -> Values -> Values
- newtype Context = Context {
- _context :: [SomeTypeRep]
- newtype Specializations = Specializations [(SomeTypeRep, Value)]
- newtype Modifiers = Modifiers [(SomeTypeRep, Function)]
Documentation
A Function 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
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
Instances
Eq ValueDescription Source # | |
Defined in Data.Registry.Internal.Types (==) :: ValueDescription -> ValueDescription -> Bool # (/=) :: ValueDescription -> ValueDescription -> Bool # | |
Show ValueDescription Source # | |
Defined in Data.Registry.Internal.Types 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
valDescriptionToText :: ValueDescription -> Text Source #
A ValueDescription as Text. If the actual content of the Value is provided display the type first then the content
A Function is the Dynamic representation of a Haskell function + its description
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
Instances
Eq FunctionDescription Source # | |
Defined in Data.Registry.Internal.Types (==) :: FunctionDescription -> FunctionDescription -> Bool # (/=) :: FunctionDescription -> FunctionDescription -> Bool # | |
Show FunctionDescription Source # | |
Defined in Data.Registry.Internal.Types showsPrec :: Int -> FunctionDescription -> ShowS # show :: FunctionDescription -> String # showList :: [FunctionDescription] -> ShowS # |
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
funDescription :: Function -> FunctionDescription Source #
The Description of a Function
funDynTypeRep :: Function -> SomeTypeRep Source #
Type representation of a Function
funDescriptionToText :: FunctionDescription -> Text Source #
A FunctionDescription as Text
hasParameters :: Function -> Bool Source #
Return True if a Function has some input values
A Typed value can be added to a Registry It is either a value, having both Show and Typeable information or a function having just Typeable information
addFunction :: Function -> Functions -> Functions Source #
Add one more Function to the list of Functions
List of values available for constructing other values
The types of values being currently built
Context | |
|
newtype Specializations Source #
Specification of values which become available for construction when a corresponding type comes in context
Instances
Show Specializations Source # | |
Defined in Data.Registry.Internal.Types showsPrec :: Int -> Specializations -> ShowS # show :: Specializations -> String # showList :: [Specializations] -> ShowS # | |
Semigroup Specializations Source # | |
Defined in Data.Registry.Internal.Types (<>) :: Specializations -> Specializations -> Specializations # sconcat :: NonEmpty Specializations -> Specializations # stimes :: Integral b => b -> Specializations -> Specializations # | |
Monoid Specializations Source # | |
Defined in Data.Registry.Internal.Types mappend :: Specializations -> Specializations -> Specializations # mconcat :: [Specializations] -> Specializations # |
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
Modifiers [(SomeTypeRep, Function)] |