Stream 0.4.7 → 0.4.7.1
raw patch · 2 files changed
+8/−7 lines, 2 files
Files
- Data/Stream.hs +7/−6
- Stream.cabal +1/−1
Data/Stream.hs view
@@ -25,6 +25,7 @@ , repeat , cycle , unfold+ , prefix -- * Extracting sublists , take , drop@@ -202,6 +203,12 @@ iterate :: (a -> a) -> a -> Stream a iterate f x = Cons x (iterate f (f x)) +-- | The 'prefix' function adds a list as a prefix to an existing+-- stream. If the list is infinite, it is converted to a Stream and+-- the second argument is ignored.+prefix :: [a] -> Stream a -> Stream a+prefix xs ys = foldr Cons ys xs+ -- | 'repeat' @x@ returns a constant stream, where all elements are -- equal to @x@. repeat :: a -> Stream a@@ -459,9 +466,3 @@ fromList :: [a] -> Stream a fromList (x:xs) = Cons x (fromList xs) fromList [] = error "Stream.fromList applied to finite list"---- | The 'prefix' function adds a list as a prefix to an existing--- stream. If the list is infinite, it is converted to a Stream and--- the second argument is ignored.-prefix :: [a] -> Stream a -> Stream a-prefix xs ys = foldr Cons ys xs
Stream.cabal view
@@ -1,5 +1,5 @@ Name: Stream-Version: 0.4.7+Version: 0.4.7.1 License: BSD3 License-file: LICENSE Author: Wouter Swierstra <wouter.swierstra@gmail.com>