mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-17 16:21:46 +03:00
11 lines
365 B
Idris
11 lines
365 B
Idris
module Data.Stream.Extra
|
|
|
|
%default total
|
|
|
|
||| Insert elements from a Foldable at the start of an existing Stream
|
|
||| @ pfx the Foldable containing elements to prepend
|
|
||| @ stream the Stream to prepend the elements to
|
|
public export
|
|
startWith : Foldable t => (pfx : t a) -> (stream : Stream a) -> Stream a
|
|
startWith pfx stream = foldr (\x, xs => x :: xs) stream pfx
|