Copyright | (c) 2018 Composewell Technologies |
---|---|
License | BSD3 |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Streams of Strings
lines :: (MonadIO m, IsStream t) => t m Char -> t m (Array Char) Source #
Break a string up into a stream of strings at newline characters. The resulting strings do not contain newlines.
lines = S.lines A.write
>>>
S.toList $ lines $ S.fromList "lines\nthis\nstring\n\n\n"
["lines","this","string","",""]
words :: (MonadIO m, IsStream t) => t m Char -> t m (Array Char) Source #
Break a string up into a stream of strings, which were delimited by characters representing white space.
words = S.words A.write
>>>
S.toList $ words $ S.fromList "A newline\nis considered white space?"
["A", "newline", "is", "considered", "white", "space?"]