Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
fold
≡foldMap
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 infoldl
f'id
xs z0- foldr1
foldr1
f t ≡ letJust
(xs,x) =unsnoc
(toList
t) infoldr
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 infoldr
f'id
xs z0- foldl1
foldl1
f t ≡ let x : xs =toList
t infoldl
f x xs- toList
toList
≡foldr
(:) []- null
null
≡foldr
(const
(const
False
))True
- length
length
≡getSum
.foldMap
(const
(Sum
1))
Note that this checks to ensure that foldl'
and foldr'
are suitably strict.
Orphan instances
Ord (Bottom Integer) Source # | |
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 # | |
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 # |