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
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