Commit e5956609 authored by John van Groningen's avatar John van Groningen
Browse files

Merge branch 'overloadedlist' into 'master'

Make the basecase for Insert and DropWhile overloaded as well

See merge request clean-compiler-and-rts/stdenv!5
parents 35d5150c 3664d961
......@@ -215,7 +215,7 @@ DropWhile f l :== dropWhile l
where
dropWhile cons=:[|a:x] | f a = dropWhile x
= cons
dropWhile [] = [|]
dropWhile [|] = [|]
Span p l :== span l
where
......@@ -262,7 +262,7 @@ where
insert_ x ls=:[|y : ys]
| r x y = [|x : ls]
= [|y : insert_ x ys]
insert_ x [] = [|x]
insert_ x [|] = [|x]
InsertAt :: !Int v:e u:(l v:e) -> u:(l v:e) | List l e,[u<=v]
special
......
......@@ -427,7 +427,7 @@ DropWhile f l :== dropWhile l
where
dropWhile cons=:[|a:x] | f a = dropWhile x
= cons
dropWhile [] = [|]
dropWhile [|] = [|]
Span p l :== span l
where
......@@ -473,7 +473,7 @@ where
insert_ x ls=:[|y : ys]
| r x y = [|x : ls]
= [|y : insert_ x ys]
insert_ x [] = [|x]
insert_ x [|] = [|x]
InsertAt :: !Int v:e u:(l v:e) -> u:(l v:e) | List l e,[u<=v]
InsertAt 0 x ys = [|x:ys]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment