Skip to content

Commit

Permalink
Merge pull request #21 from jacereda/master
Browse files Browse the repository at this point in the history
Remove redundant check
  • Loading branch information
garyb authored Nov 10, 2016
2 parents ac64482 + b747a5f commit 3963f69
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Test/QuickCheck/Laws/Data/Foldable.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import Test.QuickCheck.Laws (A, B)
import Type.Proxy (Proxy2)


-- | - foldr == foldrDefault
-- | - foldl == foldlDefault
-- | - fold == foldMap id
-- | - foldr: `foldr = foldrDefault`
-- | - foldl: `foldl = foldlDefault`
checkFoldable
eff f
. (Foldable f, Arbitrary (f A))
Expand All @@ -25,21 +24,15 @@ checkFoldable _ = do
log "Checking 'foldl' law for Foldable"
quickCheck' 1000 foldlLaw

log "Checking 'fold' law for Foldable"
quickCheck' 1000 foldLaw

where
foldrLaw :: (A -> B -> B) -> B -> f A -> Boolean
foldrLaw f z t = foldr f z t == foldrDefault f z t

foldlLaw :: (B -> A -> B) -> B -> f A -> Boolean
foldlLaw f z t = foldl f z t == foldlDefault f z t

foldLaw :: f A -> Boolean
foldLaw t = fold t == foldMap id t


-- | foldMap = fold <<< map
-- | foldMap: `foldMap = fold <<< map`
checkFoldableFunctor
eff f
. (Foldable f, Functor f, Arbitrary (f A))
Expand Down

0 comments on commit 3963f69

Please sign in to comment.