Safe Haskell | None |
---|---|
Language | Haskell2010 |
Brand/Box-validation
- class KnownNat (GetVersion brand) => IsBrand brand where
- type BoxLayout brand :: BoxForrest
- type GetVersion brand :: Nat
- type ValidBox b t = IsBrandConform b (Just t) '[]
- type ValidContainerBox b t ts = IsBrandConform b (Just t) ts
- type ValidTopLevel b ts = IsBrandConform b Nothing ts
- type family IsBrandConform (b :: Type) (parent :: Maybe Type) (ts :: [Type]) :: Constraint where ...
- data BoxTree
- type BoxForrest = [BoxTree]
- type OM b bs = OnceMandatory b bs
- type OM_ b = OnceMandatory b '[]
- type OO b bs = OnceOptional b bs
- type OO_ b = OnceOptional b '[]
- type SM b bs = SomeMandatory b bs
- type SM_ b = SomeMandatory b '[]
- type SO b bs = SomeOptional b bs
- type SO_ b = SomeOptional b '[]
Documentation
class KnownNat (GetVersion brand) => IsBrand brand Source #
A class that describes (on the type level) how a box can be nested into other boxes (see 'Boxes).
type BoxLayout brand :: BoxForrest Source #
type GetVersion brand :: Nat Source #
type ValidBox b t = IsBrandConform b (Just t) '[] Source #
Convenience wrapper around (IsBrandConform b ('Just t) '[])
type ValidContainerBox b t ts = IsBrandConform b (Just t) ts Source #
Convenience wrapper around (IsBrandConform b ('Just t) ts)
type ValidTopLevel b ts = IsBrandConform b Nothing ts Source #
Convenience wrapper around (IsBrandConform b 'Nothing ts)
type family IsBrandConform (b :: Type) (parent :: Maybe Type) (ts :: [Type]) :: Constraint where ... Source #
Boxes that valid according to the box structure defined in a IsBrand
instance, i.e. where IsBrandConform
holds.
IsBrandConform b Nothing ts = IsBrandConformImpl b (TopLevel b) ts (BoxLayout b) | |
IsBrandConform b (Just parent) ts = IsBrandConformImpl b parent ts (LookUpSubtrees parent (BoxLayout b)) |
Define the cardinality and valid child boxes of a box.
type BoxForrest = [BoxTree] Source #
A list of BoxTree
s
type OM b bs = OnceMandatory b bs Source #
Mandatory, container box, exactly one
type OM_ b = OnceMandatory b '[] Source #
Mandatory, exactly one, no children
type OO b bs = OnceOptional b bs Source #
Optional, container box, zero or one
type OO_ b = OnceOptional b '[] Source #
Optional, zero or one, no children
type SM b bs = SomeMandatory b bs Source #
Mandatory, container box, one or more
type SM_ b = SomeMandatory b '[] Source #
Mandatory, one or more, no children
type SO b bs = SomeOptional b bs Source #
Optional, container box, zero or more
type SO_ b = SomeOptional b '[] Source #
Optional, zero or more, no children