| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Falsify.Marked
Contents
Description
Marked elements
Intended for qualified import.
import Test.Falsify import qualified Test.Falsify.Marked as Marked
Synopsis
Documentation
Should an element in a container be kept or dropped?
See also Marked.
data Marked (f :: Type -> Type) a Source #
Marked element in a container
Marking elements can be a useful technique for dropping elements from a container.
- Locally marking elements to
Dropmakes it possible to enforce some global constraints about minimum number of required elements before actually dropping them (seeselectAllKept). Example:list. - For containers where we cannot remove random elements, the marks can be
used for "outwards propagation": if this element is dropped, then
those elements must also be dropped.
Example:
tree.
Instances
| Show (f a) => Show (Marked f a) Source # | |
| Eq (f a) => Eq (Marked f a) Source # | |
| Ord (f a) => Ord (Marked f a) Source # | |
Defined in Test.Falsify.Marked | |
Generation
selectAllKept :: (Traversable t, Selective f) => t (Marked f a) -> f (t (Maybe a)) Source #
Queries
countKept :: forall t (f :: Type -> Type) a. Foldable t => t (Marked f a) -> Word Source #
Count how many elements will be kept
shouldKeep :: Marked f a -> Maybe (f a) Source #
The element if it should be kept