W3cubDocs

/Haskell 8

Data.Text.Internal.Lazy.Fusion

Copyright (c) 2009 2010 Bryan O'Sullivan
License BSD-style
Maintainer [email protected]
Stability experimental
Portability GHC
Safe Haskell None
Language Haskell2010

Description

Warning: this is an internal module, and does not have a stable API or name. Functions in this module may not check or enforce preconditions expected by public modules. Use at your own risk!

Core stream fusion functionality for text.

stream :: Text -> Stream Char Source

O(n) Convert a Text into a 'Stream Char'.

unstream :: Stream Char -> Text Source

O(n) Convert a 'Stream Char' into a Text, using defaultChunkSize.

unstreamChunks :: Int -> Stream Char -> Text Source

O(n) Convert a 'Stream Char' into a Text, using the given chunk size.

length :: Stream Char -> Int64 Source

O(n) Returns the number of characters in a text.

unfoldrN :: Int64 -> (a -> Maybe (Char, a)) -> a -> Stream Char Source

O(n) Like unfoldr, unfoldrN builds a stream from a seed value. However, the length of the result is limited by the first argument to unfoldrN. This function is more efficient than unfoldr when the length of the result is known.

index :: Stream Char -> Int64 -> Char Source

O(n) stream index (subscript) operator, starting from 0.

countChar :: Char -> Stream Char -> Int64 Source

O(n) The count function returns the number of times the query element appears in the given stream.

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.8.3/docs/html/libraries/text-1.2.4.0/Data-Text-Internal-Lazy-Fusion.html