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

Safe Haskell | None
Language | Haskell98

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 :: ab
- sing :: SingI t => Sing t
- class SingI t where
- type family IncludesInfo t :: Bool
- type family Targets (l :: [a]) :: [a]
- type family NonTargets (l :: [a]) :: [a]
- type family NotSuperset (superset :: [a]) (subset :: [a]) :: CheckCombine
- type family Combine (list1 :: [a]) (list2 :: [a]) :: [a]
- data CheckCombine
  - = CannotCombineTargets
  - | CanCombine
- type family CheckCombinable (list1 :: [a]) (list2 :: [a]) :: CheckCombine
- type family (a :: Bool) && (b :: Bool) :: Bool
- type family Not (a :: Bool) :: Bool
- type family EqT (a :: t) (b :: t) :: Bool
- type family Union (list1 :: [a]) (list2 :: [a]) :: [a]

# Documentation

data MetaType Source #

Constructors

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

Instances

Eq MetaType Source # |
Methods (==) :: MetaType -> MetaType -> Bool (/=) :: MetaType -> MetaType -> Bool
Ord MetaType Source # |
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
Show MetaType Source # |
Methods showsPrec :: Int -> MetaType -> ShowS show :: MetaType -> String showList :: [MetaType] -> ShowS
SingI MetaType WithInfo Source # |
Methods sing :: Sing WithInfo t 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 #
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 #
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

type EqT MetaType WithInfo WithInfo Source # |
type EqT MetaType WithInfo WithInfo = True
type EqT MetaType WithInfo (Targeting b) Source # |
type EqT MetaType WithInfo (Targeting b) = False
type DemoteRep MetaType (KProxy MetaType) Source # |
type DemoteRep MetaType (KProxy MetaType) = MetaType
type EqT MetaType (Targeting a) WithInfo Source # |
type EqT MetaType (Targeting a) WithInfo = False
type EqT MetaType (Targeting a) (Targeting b) Source # |
type EqT MetaType (Targeting a) (Targeting b) = EqT TargetOS a b
type Cannot_ensureProperty_WithInfo MetaType ((:) MetaType t ts) Source # |
type Cannot_ensureProperty_WithInfo MetaType ((:) MetaType t ts) = (&&) (Not (EqT MetaType t WithInfo)) (Cannot_ensureProperty_WithInfo MetaType ts)
type IncludesInfo (MetaTypes [MetaType] l) Source # |
type IncludesInfo (MetaTypes [MetaType] l)

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 :: 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 [a] a1) (MetaTypes [a] b) Source # |
type (+) * (MetaTypes [a] a1) (MetaTypes [a] b)

sing :: SingI t => Sing t Source #

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 #

type family IncludesInfo t :: Bool Source #

Instances

type IncludesInfo (MetaTypes [MetaType] l) Source # |
type IncludesInfo (MetaTypes [MetaType] l)

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

Instances

type Targets a ([] a) Source # |
type Targets a ([] a) = [] a
type Targets a ((:) a x xs) Source # |
type Targets a ((:) a x xs)

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

Instances

type NonTargets a ([] a) Source # |
type NonTargets a ([] a) = [] a
type NonTargets a ((:) a x xs) Source # |
type NonTargets a ((:) a x xs)

type family NotSuperset (superset :: [a]) (subset :: [a]) :: 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 a superset ([] a) Source # |
type NotSuperset a superset ([] a) = CanCombine
type NotSuperset a superset ((:) a s rest) Source # |
type NotSuperset a superset ((:) a s rest)

type family Combine (list1 :: [a]) (list2 :: [a]) :: [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 Combine a list1 list2

data CheckCombine Source #

Constructors

CannotCombineTargets |
CanCombine |

type family CheckCombinable (list1 :: [a]) (list2 :: [a]) :: 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 a list1 ([] a) Source # |
type CheckCombinable a list1 ([] a) = CanCombine
type CheckCombinable a ([] a) list2 Source # |
type CheckCombinable a ([] a) list2 = CanCombine
type CheckCombinable a ((:) a l1 list1) ((:) a l2 list2) Source # |
type CheckCombinable a ((:) a l1 list1) ((:) a l2 list2)

type family (a :: Bool) && (b :: Bool) :: Bool Source #

Instances

type False && False Source # |
type False && False = False
type False && True Source # |
type False && True = False
type True && False Source # |
type True && False = False
type True && True Source # |
type True && True = True

type family Not (a :: Bool) :: Bool Source #

Instances

type Not False Source # |
type Not False = True
type Not True Source # |
type Not True = False

type family EqT (a :: t) (b :: t) :: Bool Source #

Type level equality

This is a very clumsy implmentation, but it works back to ghc 7.6.

Instances

type EqT TargetOS OSDebian OSDebian Source # |
type EqT TargetOS OSDebian OSDebian = True
type EqT TargetOS OSDebian OSBuntish Source # |
type EqT TargetOS OSDebian OSBuntish = False
type EqT TargetOS OSDebian OSArchLinux Source # |
type EqT TargetOS OSDebian OSArchLinux = False
type EqT TargetOS OSDebian OSFreeBSD Source # |
type EqT TargetOS OSDebian OSFreeBSD = False
type EqT TargetOS OSBuntish OSDebian Source # |
type EqT TargetOS OSBuntish OSDebian = False
type EqT TargetOS OSBuntish OSBuntish Source # |
type EqT TargetOS OSBuntish OSBuntish = True
type EqT TargetOS OSBuntish OSArchLinux Source # |
type EqT TargetOS OSBuntish OSArchLinux = False
type EqT TargetOS OSBuntish OSFreeBSD Source # |
type EqT TargetOS OSBuntish OSFreeBSD = False
type EqT TargetOS OSArchLinux OSDebian Source # |
type EqT TargetOS OSArchLinux OSDebian = False
type EqT TargetOS OSArchLinux OSBuntish Source # |
type EqT TargetOS OSArchLinux OSBuntish = False
type EqT TargetOS OSArchLinux OSArchLinux Source # |
type EqT TargetOS OSArchLinux OSArchLinux = True
type EqT TargetOS OSArchLinux OSFreeBSD Source # |
type EqT TargetOS OSArchLinux OSFreeBSD = False
type EqT TargetOS OSFreeBSD OSDebian Source # |
type EqT TargetOS OSFreeBSD OSDebian = False
type EqT TargetOS OSFreeBSD OSBuntish Source # |
type EqT TargetOS OSFreeBSD OSBuntish = False
type EqT TargetOS OSFreeBSD OSArchLinux Source # |
type EqT TargetOS OSFreeBSD OSArchLinux = False
type EqT TargetOS OSFreeBSD OSFreeBSD Source # |
type EqT TargetOS OSFreeBSD OSFreeBSD = True
type EqT MetaType WithInfo WithInfo Source # |
type EqT MetaType WithInfo WithInfo = True
type EqT MetaType WithInfo (Targeting b) Source # |
type EqT MetaType WithInfo (Targeting b) = False
type EqT MetaType (Targeting a) WithInfo Source # |
type EqT MetaType (Targeting a) WithInfo = False
type EqT MetaType (Targeting a) (Targeting b) Source # |
type EqT MetaType (Targeting a) (Targeting b) = EqT TargetOS a b

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

Type level union.

Instances

type Union a ([] a) list2 Source # |
type Union a ([] a) list2 = list2
type Union a ((:) a a1 rest) list2 Source # |
type Union a ((:) a a1 rest) list2