fitspec-0.4.5: refining property sets for testing Haskell programs

Copyright(c) 2015-2017 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellNone
LanguageHaskell2010

Test.FitSpec.Utils

Description

General purpose utility functions for FitSpec

Synopsis

Documentation

(...) :: (c -> d) -> (a -> b -> c) -> a -> b -> d Source #

Compose composed with compose operator.

(f ... g) x y === f (g x y)

uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d Source #

count :: (a -> Bool) -> [a] -> Int Source #

compositions :: [Bool] -> [Bool] Source #

compositions bs returns all compositions formed by taking values of bs

subsets :: [a] -> [[a]] Source #

subsets xs returns the list of sublists formed by taking values of xs

contained :: Eq a => [a] -> [a] -> Bool Source #

Check if all elements of a list is contained in another list

contains :: Eq a => [a] -> [a] -> Bool Source #

filterU :: (a -> a -> Bool) -> [a] -> [a] Source #

filterU filter greater-later elements in a list according to a partial ordering relation.

filterU (notContained) [[1],[2],[1,2,3],[3,4,5]] == [[1],[2],[3,4,5]]

sortAndGroupOn :: Ord b => (a -> b) -> [a] -> [[a]] Source #

sortAndGroupFstBySnd :: Ord b => [(a, b)] -> [([a], b)] Source #

sortGroupAndCollapse :: Ord b => (a -> b) -> (a -> c) -> (b -> [c] -> d) -> [a] -> [d] Source #

takeWhileIncreasing :: (a -> a -> Ordering) -> [a] -> [a] Source #

Takes values from a list while the values increase. If the original list is non-empty, the returning list will also be non-empty

takeWhileIncreasingOn :: Ord b => (a -> b) -> [a] -> [a] Source #

lastTimeout :: Int -> [a] -> IO a Source #

lastTimeout s xs will take the last value of xs it is able evaluate before s seconds elapse.

sortOn :: Ord b => (a -> b) -> [a] -> [a] Source #

(***) :: (a -> b) -> (c -> d) -> (a, c) -> (b, d) Source #