summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/T17431.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ghci/scripts/T17431.hs')
-rw-r--r--testsuite/tests/ghci/scripts/T17431.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T17431.hs b/testsuite/tests/ghci/scripts/T17431.hs
new file mode 100644
index 0000000000..78050576df
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T17431.hs
@@ -0,0 +1,10 @@
+module T17431 (sort) where
+
+sort :: Ord a => [a] -> [a]
+sort [] = []
+sort (x:xs) = insert x (sort xs)
+
+insert :: Ord a => a -> [a] -> [a]
+insert x [] = [x]
+insert x (y:ys) | x < y = x:y:ys
+ | otherwise = y:(insert x ys)