File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -832,19 +832,21 @@ elem_ a' = loop False where
832832
833833{-| An infinite stream of enumerable values, starting from a given value.
834834 It is the same as @S.iterate succ@.
835- Because their return type is polymorphic, @enumFrom@, @enumFromThen@
836- and @iterate@ are useful for example with @zip@
837- and @zipWith@, which require the same return type in the zipped streams.
838- With @each [1..]@ the following bit of connect-and-resume would be impossible:
839-
840- >>> rest <- S.print $ S.zip (S.enumFrom 'a') $ S.splitAt 3 $ S.enumFrom 1
841- ('a',1)
842- ('b',2)
843- ('c',3)
835+ Because their return type is polymorphic, @enumFrom@, @enumFromThen@
836+ and @iterate@ are useful with functions like @zip@ and @zipWith@, which
837+ require the zipped streams to have the same return type.
838+
839+ For example, with
840+ @each [1..]@ the following bit of connect-and-resume would not compile:
841+
842+ >>> rest <- S.print $ S.zip (S.enumFrom 1) $ S.splitAt 3 $ S.each ['a'..'z']
843+ (1,'a')
844+ (2,'b')
845+ (3,'c')
844846>>> S.print $ S.take 3 rest
845- 4
846- 5
847- 6
847+ 'd'
848+ 'e'
849+ 'f'
848850
849851-}
850852enumFrom :: (Monad m , Enum n ) => n -> Stream (Of n ) m r
You can’t perform that action at this time.
0 commit comments