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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Propellor.Types.MetaTypes

Synopsis

- data MetaType
  - = Targeting TargetOS
  - | WithInfo
- type UnixLike = MetaTypes '['Targeting 'OSDebian, 'Targeting 'OSBuntish, 'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
- type Linux = MetaTypes '['Targeting 'OSDebian, 'Targeting 'OSBuntish, 'Targeting 'OSArchLinux]
- type DebianLike = MetaTypes '['Targeting 'OSDebian, 'Targeting 'OSBuntish]
- type Debian = MetaTypes '['Targeting 'OSDebian]
- type Buntish = MetaTypes '['Targeting 'OSBuntish]
- type ArchLinux = MetaTypes '['Targeting 'OSArchLinux]
- type FreeBSD = MetaTypes '['Targeting 'OSFreeBSD]
- type HasInfo = MetaTypes '['WithInfo]
- type MetaTypes = Sing
- type family a + b :: Type where ...
- sing :: SingI t => Sing t
- class SingI t
- type family IncludesInfo t :: Bool where ...
- type family Targets (l :: [a]) :: [a] where ...
- type family NonTargets (l :: [a]) :: [a] where ...
- type family PrettyPrintMetaTypes (l :: [MetaType]) :: ErrorMessage where ...
- type family IsSubset (subset :: [a]) (superset :: [a]) :: Bool where ...
- type family Combine (list1 :: [a]) (list2 :: [a]) :: [a] where ...
- type family CheckCombinable (list1 :: [a]) (list2 :: [a]) :: Constraint where ...
- type family CheckCombinableNote (list1 :: [a]) (list2 :: [a]) (note :: ErrorMessage) :: Constraint where ...
- type family (a :: Bool) && (b :: Bool) :: Bool where ...
- type family Not (a :: Bool) = (res :: Bool) | res -> a where ...
- type family EqT (a :: MetaType) (b :: MetaType) where ...
- type family Union (list1 :: [a]) (list2 :: [a]) :: [a] where ...
- type family Intersect (list1 :: [a]) (list2 :: [a]) :: [a] where ...
- type family Difference (list1 :: [a]) (list2 :: [a]) :: [a] where ...
- type family IfStuck (expr :: k) (b :: k1) (c :: Exp k1) :: k1 where ...
- type DelayError (err :: ErrorMessage) = Eval (DelayErrorFcf err :: k -> Type)
- data DelayErrorFcf (a :: ErrorMessage) (b :: k)

# Documentation

data MetaType Source #

Constructors

Targeting TargetOS | A target OS of a Property
WithInfo | Indicates that a Property has associated Info

#### Instances

Instances details

Show MetaType Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods showsPrec :: Int -> MetaType -> ShowS show :: MetaType -> String showList :: [MetaType] -> ShowS
Eq MetaType Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods (==) :: MetaType -> MetaType -> Bool (/=) :: MetaType -> MetaType -> Bool
Ord MetaType Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods compare :: MetaType -> MetaType -> Ordering (<) :: MetaType -> MetaType -> Bool (<=) :: MetaType -> MetaType -> Bool (>) :: MetaType -> MetaType -> Bool (>=) :: MetaType -> MetaType -> Bool max :: MetaType -> MetaType -> MetaType min :: MetaType -> MetaType -> MetaType
SingI 'WithInfo Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing 'WithInfo Source #
SingI ('Targeting 'OSArchLinux) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSArchLinux) Source #
SingI ('Targeting 'OSBuntish) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSBuntish) Source #
SingI ('Targeting 'OSDebian) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSDebian) Source #
SingI ('Targeting 'OSFreeBSD) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSFreeBSD) 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 #
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

type DemoteRep ('KProxy :: KProxy MetaType) Source # |
Instance details Defined in Propellor.Types.MetaTypes type DemoteRep ('KProxy :: KProxy MetaType) = MetaType

type UnixLike = MetaTypes '['Targeting 'OSDebian, 'Targeting 'OSBuntish, 'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD] Source #

Any unix-like system

type Linux = MetaTypes '['Targeting 'OSDebian, 'Targeting 'OSBuntish, 'Targeting 'OSArchLinux] Source #

Any linux system

type DebianLike = MetaTypes '['Targeting 'OSDebian, 'Targeting 'OSBuntish] Source #

Debian and derivatives.

type Debian = MetaTypes '['Targeting 'OSDebian] Source #

type Buntish = MetaTypes '['Targeting 'OSBuntish] Source #

type ArchLinux = MetaTypes '['Targeting 'OSArchLinux] Source #

type FreeBSD = MetaTypes '['Targeting 'OSFreeBSD] Source #

type HasInfo = MetaTypes '['WithInfo] Source #

Used to indicate that a Property adds Info to the Host where it's used.

type MetaTypes = Sing Source #

type family a + b :: Type where ... Source #

Convenience type operator to combine two `MetaTypes` lists.

For example:

    HasInfo + Debian

Which is shorthand for this type:

    MetaTypes '[WithInfo, Targeting OSDebian]

Equations

(MetaTypes a) + (MetaTypes b) = MetaTypes (Concat a b) |

sing :: SingI t => Sing t Source #

class SingI t Source #

A class used to pass singleton values implicitly.

Minimal complete definition

sing

#### Instances

Instances details

SingI 'WithInfo Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing 'WithInfo Source #
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 ('Targeting 'OSArchLinux) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSArchLinux) Source #
SingI ('Targeting 'OSBuntish) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSBuntish) Source #
SingI ('Targeting 'OSDebian) Source # |
Instance details Defined in Propellor.Types.MetaTypes Methods sing :: Sing ('Targeting 'OSDebian) 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 #

type family IncludesInfo t :: Bool where ... Source #

Equations

IncludesInfo (MetaTypes l) = Elem 'WithInfo l |

type family Targets (l :: [a]) :: [a] where ... Source #

Equations

Targets '[] = '[] |
Targets (x ': xs) = If (IsTarget x) (x ': Targets xs) (Targets xs) |

type family NonTargets (l :: [a]) :: [a] where ... Source #

Equations

NonTargets '[] = '[] |
NonTargets (x ': xs) = If (IsTarget x) (NonTargets xs) (x ': NonTargets xs) |

type family PrettyPrintMetaTypes (l :: [MetaType]) :: ErrorMessage where ... Source #

Pretty-prints a list of MetaTypes for display in a type error message.

Equations

PrettyPrintMetaTypes '[] = 'Text "<none>" |
PrettyPrintMetaTypes (t ': '[]) = PrettyPrintMetaType t |
PrettyPrintMetaTypes (t ': ts) = (PrettyPrintMetaType t ':<>: 'Text " + ") ':<>: PrettyPrintMetaTypes ts |

type family IsSubset (subset :: [a]) (superset :: [a]) :: Bool where ... Source #

Every item in the subset must be in the superset.

Equations

IsSubset '[] superset = 'True |
IsSubset (s ': rest) superset = If (Elem s superset) (IsSubset rest superset) 'False |

type family Combine (list1 :: [a]) (list2 :: [a]) :: [a] where ... Source #

Combine two MetaTypes lists, yielding a list that has targets present in both, and nontargets present in either.

Equations

Combine ('WithInfo : list1) ('WithInfo : list2) = 'WithInfo ': (list1 `Intersect` list2) |
Combine ('WithInfo : list1) list2 = 'WithInfo ': (list1 `Intersect` list2) |
Combine list1 ('WithInfo : list2) = 'WithInfo ': (list1 `Intersect` list2) |
Combine list1 list2 = list1 `Intersect` list2 |

type family CheckCombinable (list1 :: [a]) (list2 :: [a]) :: Constraint where ... Source #

This (or CheckCombinableNote) should be used anywhere Combine is used, as an additional constraint. For example:

    foo :: CheckCombinable x y => x -> y -> Combine x y

Equations

CheckCombinable list1 list2 = If (IsCombinable list1 list2) ('True ~ 'True) (CannotCombine list1 list2 'Nothing) |

type family CheckCombinableNote (list1 :: [a]) (list2 :: [a]) (note :: ErrorMessage) :: Constraint where ... Source #

Allows providing an additional note.

Equations

CheckCombinableNote list1 list2 note = If (IsCombinable list1 list2) ('True ~ 'True) (CannotCombine list1 list2 ('Just (('Text "(" ':<>: note) ':<>: 'Text ")"))) |

type family (a :: Bool) && (b :: Bool) :: Bool where ... #

Equations

'False && a = 'False |
'True && a = a |
a && 'False = 'False |
a && 'True = a |
a && a = a |

type family Not (a :: Bool) = (res :: Bool) | res -> a where ... #

Equations

Not 'False = 'True |
Not 'True = 'False |

type family EqT (a :: MetaType) (b :: MetaType) where ... Source #

Type level equality of metatypes.

Equations

EqT a a = 'True |
EqT a b = 'False |

type family Union (list1 :: [a]) (list2 :: [a]) :: [a] where ... Source #

Type level union.

Equations

Union '[] list2 = list2 |
Union (a ': rest) list2 = If (Elem a list2 || Elem a rest) (Union rest list2) (a ': Union rest list2) |

type family Intersect (list1 :: [a]) (list2 :: [a]) :: [a] where ... Source #

Type level intersection. Duplicate list items are eliminated.

Equations

Intersect '[] list2 = '[] |
Intersect (a ': rest) list2 = If (Elem a list2 && Not (Elem a rest)) (a ': Intersect rest list2) (Intersect rest list2) |

type family Difference (list1 :: [a]) (list2 :: [a]) :: [a] where ... Source #

Type level difference. Items that are in the first list, but not in the second.

Equations

Difference '[] list2 = '[] |
Difference (a ': rest) list2 = If (Elem a list2) (Difference rest list2) (a ': Difference rest list2) |

type family IfStuck (expr :: k) (b :: k1) (c :: Exp k1) :: k1 where ... #

Equations

IfStuck (_1 AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind AnythingOfAnyKind :: k) (b :: k1) (c :: Exp k1) = b

IfStuck (a2 :: k) (b :: a1) (c :: Exp a1) = Eval c |

type DelayError (err :: ErrorMessage) = Eval (DelayErrorFcf err :: k -> Type) #

data DelayErrorFcf (a :: ErrorMessage) (b :: k) #

#### Instances

Instances details

type Eval (DelayErrorFcf a2 :: a1 -> Type) |
Instance details Defined in Type.Errors type Eval (DelayErrorFcf a2 :: a1 -> Type) = TypeError a2 :: a1