Safe Haskell | None |
---|---|
Language | Haskell2010 |
Type level functions to statically assess if a value can be built out of a Registry
For now we don't check if there could be cycles in the registry functions
Synopsis
- type family Inputs f :: [*] where ...
- type family Output f :: * where ...
- type family Contains (a :: *) (els :: [*]) :: Constraint where ...
- type (:-) out a = Contains a out
- class IsSubset (ins :: [*]) (out :: [*])
- class Solvable (ins :: [*]) (out :: [*])
- type family (x :: [k]) :++ (y :: [k]) :: [k] where ...
Documentation
type family Contains (a :: *) (els :: [*]) :: Constraint where ... Source #
Compute if a type is contained in a list of types
type (:-) out a = Contains a out Source #
Shorthand type alias when many such constraints need to be added to a type signature
class IsSubset (ins :: [*]) (out :: [*]) Source #
Compute if each element of a list of types is contained in another list
class Solvable (ins :: [*]) (out :: [*]) Source #
From the list of all the input types and outputs types of a registry Can we create all the output types?
Instances
IsSubset ins out => Solvable ins out Source # | |
Defined in Data.Registry.Solver |
type family (x :: [k]) :++ (y :: [k]) :: [k] where ... Source #
Extracted from the typelevel-sets project and adapted for the Registry datatype This union deduplicates elements only if they appear in contiguously What we really want is typelevel sets but they are too slow for now https://github.com/dorchard/type-level-sets/issues/17