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

Safe HaskellNone
LanguageHaskell98

Propellor.Types.MetaTypes

Synopsis

Documentation

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]

Instances

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

class SingI t where Source

A class used to pass singleton values implicitly.

Methods

sing :: Sing t Source

type family IncludesInfo t :: Bool Source

Instances

type family Targets l :: [a] Source

Instances

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

type family NonTargets l :: [a] Source

Instances

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.

Instances

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.

Instances

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

Instances

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

Instances

type family Not a :: Bool Source

Instances

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

type family Union list1 list2 :: [a] Source

Type level union.

Instances

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