packages feed

lazysmallcheck-0.1: benchmarks/List.hs

ord [] = True
ord [x] = True
ord (x:y:ys) = x <= y && ord (y:ys)

insert x [] = [x]
insert x (y:ys)
  | x <= y = x:y:ys
  | otherwise = y:insert x ys

merge [] ys = ys
merge xs [] = xs
merge (x:xs) (y:ys)
  | x <= y = x : merge xs (y:ys)
  | otherwise = y : merge (x:xs) ys

prop_ordInsert :: (Char, [Char]) -> Bool
prop_ordInsert (x, xs) = ord xs ==> ord (insert x xs)

prop_ordMerge :: ([Char], [Char]) -> Bool
prop_ordMerge (xs, ys) = ord xs && ord ys ==> ord (merge xs ys)