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

Safe HaskellNone




type DebianLike = MetaTypes `[Targeting OSDebian, Targeting OSBuntish]` Source

Debian and derivatives.

type HasInfo = MetaTypes `[WithInfo]` Source

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

type family a + b :: ab Source

Convenience type operator to combine two MetaTypes lists.

For example:

HasInfo + Debian

Which is shorthand for this type:

MetaTypes '[WithInfo, Targeting OSDebian]


type (+) * (MetaTypes [k] a) (MetaTypes [k] b) Source 

class SingI t where Source

A class used to pass singleton values implicitly.


sing :: Sing t Source

type family IncludesInfo t :: Bool Source


type family Targets l :: [a] Source


type Targets k ([] k) = [] k Source 
type Targets k ((:) k x xs) Source 

type family NonTargets l :: [a] Source


type NonTargets k ([] k) = [] k Source 
type NonTargets k ((:) k x xs) Source 

type family NotSuperset superset subset :: CheckCombine Source

Every item in the subset must be in the superset.

The name of this was chosen to make type errors more understandable.


type NotSuperset k superset ([] k) = CanCombine Source 
type NotSuperset k superset ((:) k s rest) Source 

type family Combine list1 list2 :: [a] Source

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


type Combine a list1 list2 Source 

type family CheckCombinable list1 list2 :: CheckCombine Source

Checks if two MetaTypes lists can be safely combined.

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

foo :: (CheckCombinable x y ~ 'CanCombine) => x -> y -> Combine x y


type CheckCombinable k list1 ([] k) = CanCombine Source 
type CheckCombinable k ([] k) list2 = CanCombine Source 
type CheckCombinable k ((:) k l1 list1) ((:) k l2 list2) Source 

type family a && b :: Bool Source


type family Not a :: Bool Source


type Not False = True Source 
type Not True = False Source 

type family Union list1 list2 :: [a] Source

Type level union.


type Union k ([] k) list2 = list2 Source 
type Union k ((:) k a rest) list2 Source