diff --git a/curry-testcases/RBT.curry b/curry-testcases/RBT.curry index d01be478a90f731561d8689aa8d7a00145361538..94aed3b779dce11df8901c1742c20ef71f01580a 100644 --- a/curry-testcases/RBT.curry +++ b/curry-testcases/RBT.curry @@ -42,4 +42,5 @@ isRBT t = (blackBalanced t) && (redNodesHaveBlackChildren t) valuesWithin :: Tree -> Int -> Bool valuesWithin Empty _ = True -valuesWithin (Node _ v l r) bound = 0 <= v && v <= bound && (valuesWithin l bound) && (valuesWithin r bound) +valuesWithin (Node _ v l r) bound = + 0 <= v && v <= bound && (valuesWithin l bound) && (valuesWithin r bound) diff --git a/curry-testcases/SortedList.curry b/curry-testcases/SortedList.curry new file mode 100644 index 0000000000000000000000000000000000000000..d981bcbe1b0bee0ea61c2c4e01a3b77391650d6e --- /dev/null +++ b/curry-testcases/SortedList.curry @@ -0,0 +1,16 @@ +module SortedList + (isSorted, size + ) where + +isSorted :: [Int] -> Bool +isSorted [] = True +isSorted [_] = True +isSorted (x:y:ys) = x <= y && (isSorted (y:ys)) + +size :: [Int] -> Int +size [] = 0 +size (_:xs) = 1 + (size xs) + +contains :: [Int] -> Int -> Bool +contains [] _ = False +contains (x:xs) e = (x == e) || (contains xs e)