Shpadoinkle-widgets-0.2.0.1: A collection of common reusable types and components.

Safe HaskellNone
LanguageHaskell2010

Test.QuickCheck.Classes.FoldableOrd

Contents

Synopsis

Documentation

foldableLaws :: forall proxy f. (Foldable f, forall a. Show a => Show (f a), forall a. (Arbitrary a, Ord a) => Arbitrary (f a)) => proxy f -> Laws Source #

Tests the following Foldable properties:

fold
foldfoldMap id
foldMap
foldMap f ≡ foldr (mappend . f) mempty
foldr
foldr f z t ≡ appEndo (foldMap (Endo . f) t ) z
foldr'
foldr' f z0 xs ≡ let f' k x z = k $! f x z in foldl f' id xs z0
foldr1
foldr1 f t ≡ let Just (xs,x) = unsnoc (toList t) in foldr f x xs
foldl
foldl f z t ≡ appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
foldl'
foldl' f z0 xs ≡ let f' x k z = k $! f z x in foldr f' id xs z0
foldl1
foldl1 f t ≡ let x : xs = toList t in foldl f x xs
toList
toListfoldr (:) []
null
nullfoldr (const (const False)) True
length
lengthgetSum . foldMap (const (Sum 1))

Note that this checks to ensure that foldl' and foldr' are suitably strict.

Orphan instances

Ord (Bottom Integer) Source # 
Instance details

Methods

compare :: Bottom Integer -> Bottom Integer -> Ordering Source #

(<) :: Bottom Integer -> Bottom Integer -> Bool Source #

(<=) :: Bottom Integer -> Bottom Integer -> Bool Source #

(>) :: Bottom Integer -> Bottom Integer -> Bool Source #

(>=) :: Bottom Integer -> Bottom Integer -> Bool Source #

max :: Bottom Integer -> Bottom Integer -> Bottom Integer Source #

min :: Bottom Integer -> Bottom Integer -> Bottom Integer Source #

Ord (VerySmallList Integer) Source # 
Instance details

Methods

compare :: VerySmallList Integer -> VerySmallList Integer -> Ordering Source #

(<) :: VerySmallList Integer -> VerySmallList Integer -> Bool Source #

(<=) :: VerySmallList Integer -> VerySmallList Integer -> Bool Source #

(>) :: VerySmallList Integer -> VerySmallList Integer -> Bool Source #

(>=) :: VerySmallList Integer -> VerySmallList Integer -> Bool Source #

max :: VerySmallList Integer -> VerySmallList Integer -> VerySmallList Integer Source #

min :: VerySmallList Integer -> VerySmallList Integer -> VerySmallList Integer Source #