Add Haddock poperty test

This commit is contained in:
Ranjeet Kumar Ranjan 2021-08-03 12:55:19 +05:30
parent d9abfa1d87
commit 04a0547afd
3 changed files with 15 additions and 15 deletions

View File

@ -928,16 +928,16 @@ splitSuffixBy' predicate f m =
--
-- 'splitOn' is an inverse of 'intercalate'. The following law always holds:
--
-- > intercalate . splitOn == id
-- prop> intercalate . splitOn == id
--
-- The following law holds when the separator is non-empty and contains none of
-- the elements present in the input lists:
--
-- > splitOn . intercalate == id
-- prop> splitOn . intercalate == id
--
-- The following law always holds:
--
-- > concat . splitOn . intercalate == concat
-- prop> concat . splitOn . intercalate == concat
--
-- @since 0.7.0
{-# INLINE splitOn #-}

View File

@ -547,12 +547,12 @@ concatM generator = concatMapM (\() -> generator) (fromPure ())
--
-- 'splitOnSeq' is an inverse of 'intercalate'. The following law always holds:
--
-- > intercalate . splitOn == id
-- prop> intercalate . splitOn == id
--
-- The following law holds when the separator is non-empty and contains none of
-- the elements present in the input lists:
--
-- > splitOn . intercalate == id
-- prop> splitOn . intercalate == id
--
-- /Pre-release/

View File

@ -600,8 +600,8 @@ module Streamly.Prelude
--
-- The following equations hold for lists:
--
-- > scanl f z xs == map (foldl f z) $ inits xs
-- > scanr f z xs == map (foldr f z) $ tails xs
-- prop> scanl f z xs == map (foldl f z) $ inits xs
-- prop> scanr f z xs == map (foldr f z) $ tails xs
--
-- @
-- > scanl (+) 0 [1,2,3,4]
@ -621,8 +621,8 @@ module Streamly.Prelude
--
-- Left and right scans are duals:
--
-- > scanr f z xs == reverse $ scanl (flip f) z (reverse xs)
-- > scanl f z xs == reverse $ scanr (flip f) z (reverse xs)
-- prop> scanr f z xs == reverse $ scanl (flip f) z (reverse xs)
-- prop> scanl f z xs == reverse $ scanr (flip f) z (reverse xs)
--
-- A scan is a stateful map i.e. a combination of map and fold:
--
@ -1023,9 +1023,9 @@ import Streamly.Internal.Data.Stream.IsStream
-- @foldr f z xs@) fully before it yields an output expression, resulting in
-- the following /right associated expression/:
--
-- @
-- foldr f z xs == x1 \`f` (x2 \`f` ...(xn \`f` z))
-- @
--
-- prop> foldr f z xs == x1 `f` (x2 `f` ...(xn `f` z))
--
--
-- For example,
--
@ -1116,9 +1116,9 @@ import Streamly.Internal.Data.Stream.IsStream
-- Notice, the order of the arguments to the step function @f b a@. It follows
-- the left associative recursive expression generated by expanding @b \`f` a@.
--
-- @
-- foldl f z xs == (((z \`f` x1) \`f` x2) ...) \`f` xn
-- @
--
-- prop> foldl f z xs == (((z `f` x1) `f` x2) ...) `f` xn
--
--
--
-- The strict left fold @foldl'@ forces the reduction of its argument @z \`f`