propellor-5.3.3: property-based host configuration management in haskell

Safe Haskell | Safe
Language | Haskell98

Propellor.Types.Singletons

Description

Simple implementation of singletons, portable back to ghc 7.6.3

Synopsis

- data family Sing (x :: k)
- class SingI t where
- class kparam ~ KProxy => SingKind kparam where
  - type DemoteRep kparam :: *
- data KProxy t :: * -> * = KProxy

# Documentation

data family Sing (x :: k) Source #

The data family of singleton types.

Instances

SingI k metatypes => Monoid (Property (MetaTypes k metatypes)) | Any type of Property is a monoid. When properties x and y are appended together, the resulting property has a description like "x and y". Note that when x fails to be ensured, it will not try to ensure y.
Methods mempty :: Property (MetaTypes k metatypes) mappend :: Property (MetaTypes k metatypes) -> Property (MetaTypes k metatypes) -> Property (MetaTypes k metatypes) mconcat :: [Property (MetaTypes k metatypes)] -> Property (MetaTypes k metatypes)
((~) CheckCombine (CheckCombinable a x y) CanCombine, SingI [a] (Combine a x y)) => Combines (Property (MetaTypes [a] x)) (Property (MetaTypes [a] y)) Source # |
Methods combineWith :: ResultCombiner -> ResultCombiner -> Property (MetaTypes [a] x) -> Property (MetaTypes [a] y) -> CombinedType (Property (MetaTypes [a] x)) (Property (MetaTypes [a] y)) Source #
((~) CheckCombine (CheckCombinable a x y) CanCombine, SingI [a] (Combine a x y)) => Combines (Property (MetaTypes [a] x)) (RevertableProperty (MetaTypes [a] y) (MetaTypes k y')) Source # |
Methods combineWith :: ResultCombiner -> ResultCombiner -> Property (MetaTypes [a] x) -> RevertableProperty (MetaTypes [a] y) (MetaTypes k y') -> CombinedType (Property (MetaTypes [a] x)) (RevertableProperty (MetaTypes [a] y) (MetaTypes k y')) Source #
((~) CheckCombine (CheckCombinable a x y) CanCombine, SingI [a] (Combine a x y)) => Combines (RevertableProperty (MetaTypes [a] x) (MetaTypes k x')) (Property (MetaTypes [a] y)) Source # |
Methods combineWith :: ResultCombiner -> ResultCombiner -> RevertableProperty (MetaTypes [a] x) (MetaTypes k x') -> Property (MetaTypes [a] y) -> CombinedType (RevertableProperty (MetaTypes [a] x) (MetaTypes k x')) (Property (MetaTypes [a] y)) Source #
((~) CheckCombine (CheckCombinable a1 x y) CanCombine, (~) CheckCombine (CheckCombinable a x' y') CanCombine, SingI [a1] (Combine a1 x y), SingI [a] (Combine a x' y')) => Combines (RevertableProperty (MetaTypes [a1] x) (MetaTypes [a] x')) (RevertableProperty (MetaTypes [a1] y) (MetaTypes [a] y')) Source # |
Methods combineWith :: ResultCombiner -> ResultCombiner -> RevertableProperty (MetaTypes [a1] x) (MetaTypes [a] x') -> RevertableProperty (MetaTypes [a1] y) (MetaTypes [a] y') -> CombinedType (RevertableProperty (MetaTypes [a1] x) (MetaTypes [a] x')) (RevertableProperty (MetaTypes [a1] y) (MetaTypes [a] y')) Source #
data Sing Bool Source # |

data Sing Bool where

- TrueS :: Sing Bool True
- FalseS :: Sing Bool False

data Sing MetaType Source # |

data Sing MetaType where

- OSDebianS :: Sing MetaType (Targeting OSDebian)
- OSBuntishS :: Sing MetaType (Targeting OSBuntish)
- OSFreeBSDS :: Sing MetaType (Targeting OSFreeBSD)
- OSArchLinuxS :: Sing MetaType (Targeting OSArchLinux)
- WithInfoS :: Sing MetaType WithInfo

data Sing [k] Source # |

data Sing [k] where

- Nil :: Sing [k] ([] k)
- Cons :: Sing [a] ((:) a x xs)

type CombinedType (Property (MetaTypes [a] x)) (Property (MetaTypes [a] y)) Source # |
type CombinedType (Property (MetaTypes [a] x)) (Property (MetaTypes [a] y)) = Property (MetaTypes [a] (Combine a x y))
type CombinedType (Property (MetaTypes [a] x)) (RevertableProperty (MetaTypes [a] y) (MetaTypes k y')) Source # |
type CombinedType (Property (MetaTypes [a] x)) (RevertableProperty (MetaTypes [a] y) (MetaTypes k y')) = Property (MetaTypes [a] (Combine a x y))
type (+) * (MetaTypes [a] a1) (MetaTypes [a] b) Source # |
type (+) * (MetaTypes [a] a1) (MetaTypes [a] b)
type IncludesInfo (MetaTypes [MetaType] l) Source # |
type IncludesInfo (MetaTypes [MetaType] l)
type CombinedType (RevertableProperty (MetaTypes [a] x) (MetaTypes k x')) (Property (MetaTypes [a] y)) Source # |
type CombinedType (RevertableProperty (MetaTypes [a] x) (MetaTypes k x')) (Property (MetaTypes [a] y)) = Property (MetaTypes [a] (Combine a x y))
type CombinedType (RevertableProperty (MetaTypes [a1] x) (MetaTypes [a] x')) (RevertableProperty (MetaTypes [a1] y) (MetaTypes [a] y')) Source # |
type CombinedType (RevertableProperty (MetaTypes [a1] x) (MetaTypes [a] x')) (RevertableProperty (MetaTypes [a1] y) (MetaTypes [a] y')) = RevertableProperty (MetaTypes [a1] (Combine a1 x y)) (MetaTypes [a] (Combine a x' y'))

class SingI t where Source #

A class used to pass singleton values implicitly.

Minimal complete definition

sing

Methods

sing :: Sing t Source #

Instances

SingI Bool False Source # |
Methods sing :: Sing False t Source #
SingI Bool True Source # |
Methods sing :: Sing True t Source #
SingI MetaType WithInfo Source # |
Methods sing :: Sing WithInfo t Source #
SingI MetaType (Targeting OSDebian) Source # |
Methods sing :: Sing (Targeting OSDebian) t Source #
SingI MetaType (Targeting OSBuntish) Source # |
Methods sing :: Sing (Targeting OSBuntish) t Source #
SingI MetaType (Targeting OSArchLinux) Source # |
Methods sing :: Sing (Targeting OSArchLinux) t Source #
SingI MetaType (Targeting OSFreeBSD) Source # |
Methods sing :: Sing (Targeting OSFreeBSD) t Source #
SingI [k] ([] k) Source # |
Methods sing :: Sing [k] t Source #
(SingI a x, SingI [a] xs) => SingI [a] ((:) a x xs) Source # |
Methods sing :: Sing ((a ': x) xs) t Source #

class kparam ~ KProxy => SingKind kparam where Source #

Minimal complete definition

fromSing

Associated Types

type DemoteRep kparam :: * Source #

Methods

fromSing :: Sing (a :: k) -> DemoteRep kparam Source #

From singleton to value.

Instances

SingKind Bool (KProxy Bool) Source # |
Associated Types type DemoteRep (KProxy Bool) (kparam :: KProxy (KProxy Bool)) :: * Source # Methods fromSing :: Sing (KProxy Bool) a -> DemoteRep (KProxy Bool) kparam Source #
SingKind MetaType (KProxy MetaType) Source # |
Associated Types type DemoteRep (KProxy MetaType) (kparam :: KProxy (KProxy MetaType)) :: * Source # Methods fromSing :: Sing (KProxy MetaType) a -> DemoteRep (KProxy MetaType) kparam Source #
SingKind a (KProxy a) => SingKind [a] (KProxy [a]) Source # |
Associated Types type DemoteRep (KProxy [a]) (kparam :: KProxy (KProxy [a])) :: * Source # Methods fromSing :: Sing (KProxy [a]) a -> DemoteRep (KProxy [a]) kparam Source #

data KProxy t :: * -> * #

Constructors

KProxy |