Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
main :: [sys_message]
|
||||
main = [Stdout ("Before: " ++ show testlist ++ "\n"),
|
||||
Stdout ("After: " ++ show (insertionsort testlist) ++ "\n")]
|
||||
where testlist = [4,65,2,-31,0,99,2,83,782,1]
|
||||
|
||||
|
||||
insertionsort :: [*]->[*]
|
||||
insertionsort = foldr insert []
|
||||
|
||||
insert :: *->[*]->[*]
|
||||
insert x [] = [x]
|
||||
insert x (y:ys) = x:y:ys, if x<y
|
||||
= y:insert x ys, otherwise
|
||||
Loading…
Add table
Add a link
Reference in a new issue