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

Safe Haskell | Safe
Language | Haskell2010

Propellor.Types.Singletons

Description

Simple implementation of singletons, portable back to ghc 7.6.3

Synopsis

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

# Documentation

class kparam ~ 'KProxy => SingKind (kparam :: KProxy k) where Source #

Associated Types

type DemoteRep kparam :: * Source #

Methods

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

From singleton to value.

#### Instances

Instances details

SingKind ('KProxy :: KProxy Bool) Source # |
Instance details Defined in Propellor.Types.Singletons Associated Types type DemoteRep 'KProxy Source # Methods fromSing :: forall (a :: k). Sing a -> DemoteRep 'KProxy Source #
SingKind ('KProxy :: KProxy MetaType) Source # |
Instance details Defined in Propellor.Types.MetaTypes Associated Types type DemoteRep 'KProxy Source # Methods fromSing :: forall (a :: k). Sing a -> DemoteRep 'KProxy Source #
SingKind ('KProxy :: KProxy a) => SingKind ('KProxy :: KProxy [a]) Source # |
Instance details Defined in Propellor.Types.Singletons Associated Types type DemoteRep 'KProxy Source # Methods fromSing :: forall (a0 :: k). Sing a0 -> DemoteRep 'KProxy Source #

class SingI t where Source #

A class used to pass singleton values implicitly.

Methods

sing :: Sing t Source #

#### Instances

Instances details

SingI 'False Source # |
Instance details Defined in Propellor.Types.Singletons Methods sing :: Sing 'False Source #
SingI 'True Source # |
Instance details Defined in Propellor.Types.Singletons Methods sing :: Sing 'True Source #
SingI 'WithInfo Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing 'WithInfo Source #
SingI ('Targeting 'OSDebian) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSDebian) Source #
SingI ('Targeting 'OSBuntish) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSBuntish) Source #
SingI ('Targeting 'OSArchLinux) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSArchLinux) Source #
SingI ('Targeting 'OSFreeBSD) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSFreeBSD) Source #
SingI ('[] :: [k]) Source # |
Instance details Defined in Propellor.Types.Singletons Methods sing :: Sing '[] Source #
(SingI x, SingI xs) => SingI (x ': xs :: [a]) Source # |
Instance details Defined in Propellor.Types.Singletons Methods sing :: Sing (x ': xs) Source #

data family Sing (x :: k) Source #

The data family of singleton types.

#### Instances

Instances details

SingI metatypes => Semigroup (Property (MetaTypes metatypes)) | Any type of Property is a Semigroup. 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.
Instance details Defined in Propellor.Types Methods (<>) :: Property (MetaTypes metatypes) -> Property (MetaTypes metatypes) -> Property (MetaTypes metatypes) # sconcat :: NonEmpty (Property (MetaTypes metatypes)) -> Property (MetaTypes metatypes) stimes :: Integral b => b -> Property (MetaTypes metatypes) -> Property (MetaTypes metatypes)
SingI metatypes => Monoid (Property (MetaTypes metatypes)) Source # | Any type of Property is a Monoid.
Instance details Defined in Propellor.Types Methods mempty :: Property (MetaTypes metatypes) # mappend :: Property (MetaTypes metatypes) -> Property (MetaTypes metatypes) -> Property (MetaTypes metatypes) # mconcat :: [Property (MetaTypes metatypes)] -> Property (MetaTypes metatypes) #
(CheckCombinable x y, SingI (Combine x y)) => Combines (Property (MetaTypes x)) (Property (MetaTypes y)) Source # |
Instance details Defined in Propellor.Types Methods combineWith :: ResultCombiner -> ResultCombiner -> Property (MetaTypes x) -> Property (MetaTypes y) -> CombinedType (Property (MetaTypes x)) (Property (MetaTypes y)) Source #
(CheckCombinable x y, SingI (Combine x y)) => Combines (Property (MetaTypes x)) (RevertableProperty (MetaTypes y) (MetaTypes y')) Source # |
Instance details Defined in Propellor.Types Methods combineWith :: ResultCombiner -> ResultCombiner -> Property (MetaTypes x) -> RevertableProperty (MetaTypes y) (MetaTypes y') -> CombinedType (Property (MetaTypes x)) (RevertableProperty (MetaTypes y) (MetaTypes y')) Source #

(Semigroup (Property (MetaTypes setupmetatypes)), Semigroup (Property (MetaTypes undometatypes)), SingI setupmetatypes, SingI undometatypes) => Semigroup (RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes))

Any type of RevertableProperty is a Semigroup. When revertable properties x and y are appended together, the resulting revertable property has a description like "x and y". Note that when x fails to be ensured, it will not try to ensure y.

Instance details

Defined in Propellor.Types

Methods

(<>) :: RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes) -> RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes) -> RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes) #

sconcat :: NonEmpty (RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes)) -> RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes)

stimes :: Integral b => b -> RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes) -> RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes)

(Monoid (Property (MetaTypes setupmetatypes)), Monoid (Property (MetaTypes undometatypes)), SingI setupmetatypes, SingI undometatypes) => Monoid (RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes)) Source # |

Instance details

Defined in Propellor.Types

Methods

mempty :: RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes) #

mappend :: RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes) -> RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes) -> RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes) #

mconcat :: [RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes)] -> RevertableProperty (MetaTypes setupmetatypes) (MetaTypes undometatypes) #

(CheckCombinable x y, SingI (Combine x y)) => Combines (RevertableProperty (MetaTypes x) (MetaTypes x')) (Property (MetaTypes y)) Source # |
Instance details Defined in Propellor.Types Methods combineWith :: ResultCombiner -> ResultCombiner -> RevertableProperty (MetaTypes x) (MetaTypes x') -> Property (MetaTypes y) -> CombinedType (RevertableProperty (MetaTypes x) (MetaTypes x')) (Property (MetaTypes y)) Source #
(CheckCombinable x y, CheckCombinable x' y', SingI (Combine x y), SingI (Combine x' y')) => Combines (RevertableProperty (MetaTypes x) (MetaTypes x')) (RevertableProperty (MetaTypes y) (MetaTypes y')) Source # |
Instance details Defined in Propellor.Types Methods combineWith :: ResultCombiner -> ResultCombiner -> RevertableProperty (MetaTypes x) (MetaTypes x') -> RevertableProperty (MetaTypes y) (MetaTypes y') -> CombinedType (RevertableProperty (MetaTypes x) (MetaTypes x')) (RevertableProperty (MetaTypes y) (MetaTypes y')) Source #
data Sing (x :: Bool) Source # |

Instance details

Defined in Propellor.Types.Singletons

data Sing (x :: Bool) where

- TrueS :: Sing 'True
- FalseS :: Sing 'False

data Sing (x :: MetaType) Source # |

Instance details

Defined in Propellor.Types.MetaTypes

data Sing (x :: MetaType) where

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

data Sing (x :: [k]) Source # |

Instance details

Defined in Propellor.Types.Singletons

data Sing (x :: [k]) where

- Nil :: forall k. Sing ('[] :: [k])
- Cons :: forall a (x :: a) (xs :: [a]). Sing x -> Sing xs -> Sing (x ': xs)

data KProxy t #

Constructors

KProxy |