mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-27 13:43:28 +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
|