Commit 3664d961 authored by Mart Lubbers's avatar Mart Lubbers

Make the basecase for Insert and DropWhile overloaded as well

parent 35d5150c
...@@ -215,7 +215,7 @@ DropWhile f l :== dropWhile l ...@@ -215,7 +215,7 @@ DropWhile f l :== dropWhile l
where where
dropWhile cons=:[|a:x] | f a = dropWhile x dropWhile cons=:[|a:x] | f a = dropWhile x
= cons = cons
dropWhile [] = [|] dropWhile [|] = [|]
Span p l :== span l Span p l :== span l
where where
...@@ -262,7 +262,7 @@ where ...@@ -262,7 +262,7 @@ where
insert_ x ls=:[|y : ys] insert_ x ls=:[|y : ys]
| r x y = [|x : ls] | r x y = [|x : ls]
= [|y : insert_ x ys] = [|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 :: !Int v:e u:(l v:e) -> u:(l v:e) | List l e,[u<=v]
special special
......
...@@ -427,7 +427,7 @@ DropWhile f l :== dropWhile l ...@@ -427,7 +427,7 @@ DropWhile f l :== dropWhile l
where where
dropWhile cons=:[|a:x] | f a = dropWhile x dropWhile cons=:[|a:x] | f a = dropWhile x
= cons = cons
dropWhile [] = [|] dropWhile [|] = [|]
Span p l :== span l Span p l :== span l
where where
...@@ -473,7 +473,7 @@ where ...@@ -473,7 +473,7 @@ where
insert_ x ls=:[|y : ys] insert_ x ls=:[|y : ys]
| r x y = [|x : ls] | r x y = [|x : ls]
= [|y : insert_ x ys] = [|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 :: !Int v:e u:(l v:e) -> u:(l v:e) | List l e,[u<=v]
InsertAt 0 x ys = [|x:ys] 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