Commit e94e1b6c authored by John van Groningen's avatar John van Groningen

use overloaded lists instead of lazy lists in Span

parent 13582d1d
......@@ -219,13 +219,13 @@ DropWhile f l :== dropWhile l
Span p l :== span l
where
span list=:[x:xs]
span list=:[|x:xs]
| p x
= ([x:ys],zs)
with (ys,zs) = span xs
= ([],list)
span []
= ([], [])
# (ys,zs) = span xs
= ([|x:ys],zs)
= ([|],list)
span [|]
= ([|], [|])
//Filter :: (e -> .Bool) !.(l e) -> .(l e) | List l e
Filter f l :== filter l
......
......@@ -431,13 +431,13 @@ DropWhile f l :== dropWhile l
Span p l :== span l
where
span list=:[x:xs]
span list=:[|x:xs]
| p x
= ([x:ys],zs)
with (ys,zs) = span xs
= ([],list)
span []
= ([], [])
# (ys,zs) = span xs
= ([|x:ys],zs)
= ([|],list)
span [|]
= ([|], [|])
//Filter :: (e -> .Bool) !.(l e) -> .(l e) | List l e
Filter f l :== filter l
......
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