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

Propellor.Types.ResultCheck

Synopsis

Documentation

This is a Property but its Result is not accurate; in particular it may return NoChange despite having made a change.

However, when it returns MadeChange, it really did make a change, and FailedChange is still an error.

Instances

 Source # MethodstightenTargets :: ((CheckCombine ~ NotSuperset a (Targets a untightened) (Targets a tightened)) CanCombine, (CheckCombine ~ NotSuperset a (NonTargets a tightened) (NonTargets a untightened)) CanCombine, SingI [a] tightened) => UncheckedProperty (MetaTypes [a] untightened) -> UncheckedProperty (MetaTypes [a] tightened) Source # Source # Methods

Use to indicate that a Property is unchecked.

Arguments

 :: (Checkable p i, LiftPropellor m) => m a Run before ensuring the property. -> (a -> m Result) Run after ensuring the property. Return MadeChange if a change was detected, or NoChange if no change was detected. -> p i -> Property i

Checks the result of a property. Mostly used to convert a UncheckedProperty to a Property, but can also be used to further check a Property.

check :: (Checkable p i, LiftPropellor m) => m Bool -> p i -> Property i Source #

Makes a Property or an UncheckedProperty only run when a test succeeds.

class Checkable p i Source #

Minimal complete definition

checkedProp, preCheckedProp

Instances

 Source # MethodscheckedProp :: Property i -> Property i Source # Methods

assume :: Checkable p i => p i -> Result -> Property i Source #

Sometimes it's not practical to test if a property made a change. In such a case, it's often fine to say:

someprop assume MadeChange

However, beware assuming NoChange, as that will make combinators like onChange not work.