Safe Haskell | None |
---|---|

Language | Haskell98 |

## Synopsis

- data MetaType
- 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 :: * 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 NotSuperset (superset :: [a]) (subset :: [a]) :: CheckCombine where ...
- type family Combine (list1 :: [a]) (list2 :: [a]) :: [a] where ...
- data CheckCombine
- type family CheckCombinable (list1 :: [a]) (list2 :: [a]) :: CheckCombine 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 ...

# Documentation

## Instances

Eq MetaType Source # | |

Ord MetaType Source # | |

Defined in Propellor.Types.MetaTypes | |

Show MetaType Source # | |

SingI WithInfo Source # | |

SingKind (KProxy :: KProxy MetaType) Source # | |

SingI (Targeting OSDebian) Source # | |

SingI (Targeting OSBuntish) Source # | |

SingI (Targeting OSArchLinux) Source # | |

Defined in Propellor.Types.MetaTypes | |

SingI (Targeting OSFreeBSD) Source # | |

data Sing (x :: MetaType) Source # | |

Defined in Propellor.Types.MetaTypes | |

type DemoteRep (KProxy :: KProxy MetaType) Source # | |

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 HasInfo = MetaTypes '[WithInfo] Source #

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

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

Convenience type operator to combine two `MetaTypes`

lists.

For example:

HasInfo + Debian

Which is shorthand for this type:

MetaTypes '[WithInfo, Targeting OSDebian]

A class used to pass singleton values implicitly.

## Instances

SingI False Source # | |

SingI True Source # | |

SingI WithInfo Source # | |

SingI (Targeting OSDebian) Source # | |

SingI (Targeting OSBuntish) Source # | |

SingI (Targeting OSArchLinux) Source # | |

Defined in Propellor.Types.MetaTypes | |

SingI (Targeting OSFreeBSD) Source # | |

SingI ([] :: [k]) Source # | |

Defined in Propellor.Types.Singletons | |

(SingI x, SingI xs) => SingI (x ': xs :: [a]) Source # | |

Defined in Propellor.Types.Singletons |

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

IncludesInfo (MetaTypes l) = Elem WithInfo l |

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

NonTargets '[] = '[] | |

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

type family NotSuperset (superset :: [a]) (subset :: [a]) :: CheckCombine where ... Source #

Every item in the subset must be in the superset.

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

NotSuperset superset '[] = CanCombine | |

NotSuperset superset (s ': rest) = If (Elem s superset) (NotSuperset superset rest) CannotCombineTargets |

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.

Combine (list1 :: [a]) (list2 :: [a]) = Concat (NonTargets list1 `Union` NonTargets list2) (Targets list1 `Intersect` Targets list2) |

type family CheckCombinable (list1 :: [a]) (list2 :: [a]) :: CheckCombine where ... 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

CheckCombinable '[] list2 = CanCombine | |

CheckCombinable list1 '[] = CanCombine | |

CheckCombinable (l1 ': list1) (l2 ': list2) = CheckCombinable' (Combine (l1 ': list1) (l2 ': list2)) |

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

Type-level "not". An injective type family since `4.10.0.0`

.

*Since: base-4.7.0.0*