-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An efficient packed Unicode text type -- -- An efficient packed Unicode text type. @package text @version 0.1 -- | Text manipulation functions represented as fusible operations over -- streams. module Data.Text.Fusion data Stream a Stream :: (s -> Step s a) -> !s -> {-# UNPACK #-} !Int -> Stream a data Step s a Done :: Step s a Skip :: !s -> Step s a Yield :: !a -> !s -> Step s a -- | O(n) Convert a Text into a 'Stream Char'. stream :: Text -> Stream Char -- | O(n) Convert a Stream Char into a Text. unstream :: Stream Char -> Text -- | O(n) Convert a Text into a 'Stream Char', but iterate -- backwards. reverseStream :: Text -> Stream Char -- | The empty stream. empty :: Stream Char -- | O(n) Adds a character to the front of a Stream Char. cons :: Char -> Stream Char -> Stream Char -- | O(n) Adds a character to the end of a stream. snoc :: Stream Char -> Char -> Stream Char -- | O(n) Appends one Stream to the other. append :: Stream Char -> Stream Char -> Stream Char -- | O(1) Returns the first character and remainder of a 'Stream -- Char', or Nothing if empty. Subject to array fusion. uncons :: Stream Char -> Maybe (Char, Stream Char) -- | O(1) Returns the first character of a Text, which must be -- non-empty. Subject to array fusion. head :: Stream Char -> Char -- | O(1) Returns all characters after the head of a Stream Char, -- which must be non-empty. tail :: Stream Char -> Stream Char -- | O(n) Returns the last character of a 'Stream Char', which must -- be non-empty. last :: Stream Char -> Char -- | O(1) Returns all but the last character of a Stream Char, which -- must be non-empty. init :: Stream Char -> Stream Char -- | O(1) Tests whether a Stream Char is empty or not. null :: Stream Char -> Bool -- | O(n) Returns the number of characters in a text. length :: Stream Char -> Int -- | O(n) Determines if two streams are equal. eq :: Ord a => Stream a -> Stream a -> Bool -- | O(n) map f xs is the Stream Char obtained by -- applying f to each element of xs. map :: (Char -> Char) -> Stream Char -> Stream Char intercalate :: Stream Char -> [Stream Char] -> Stream Char -- | O(n) Take a character and place it between each of the -- characters of a 'Stream Char'. intersperse :: Char -> Stream Char -> Stream Char -- | O(n) Reverse the characters of a string. reverse :: Stream Char -> Text -- | foldl, applied to a binary operator, a starting value (typically the -- left-identity of the operator), and a Stream, reduces the Stream using -- the binary operator, from left to right. foldl :: (b -> Char -> b) -> b -> Stream Char -> b -- | A strict version of foldl. foldl' :: (b -> Char -> b) -> b -> Stream Char -> b -- | foldl1 is a variant of foldl that has no starting value argument, and -- thus must be applied to non-empty Streams. foldl1 :: (Char -> Char -> Char) -> Stream Char -> Char -- | A strict version of foldl1. foldl1' :: (Char -> Char -> Char) -> Stream Char -> Char -- | foldr, applied to a binary operator, a starting value -- (typically the right-identity of the operator), and a stream, reduces -- the stream using the binary operator, from right to left. foldr :: (Char -> b -> b) -> b -> Stream Char -> b -- | foldr1 is a variant of foldr that has no starting value -- argument, and thus must be applied to non-empty streams. Subject to -- array fusion. foldr1 :: (Char -> Char -> Char) -> Stream Char -> Char -- | O(n) Concatenate a list of streams. Subject to array fusion. concat :: [Stream Char] -> Stream Char -- | Map a function over a stream that results in a stream and concatenate -- the results. concatMap :: (Char -> Stream Char) -> Stream Char -> Stream Char -- | O(n) any p xs determines if any character in the -- stream xs satisifes the predicate p. any :: (Char -> Bool) -> Stream Char -> Bool -- | O(n) all p xs determines if all characters in the -- Text xs satisify the predicate p. all :: (Char -> Bool) -> Stream Char -> Bool -- | O(n) maximum returns the maximum value from a stream, which -- must be non-empty. maximum :: Stream Char -> Char -- | O(n) minimum returns the minimum value from a Text, -- which must be non-empty. minimum :: Stream Char -> Char scanl :: (Char -> Char -> Char) -> Char -> Stream Char -> Stream Char -- | O(n) Perform the equivalent of scanr over a list, only -- with the input and result reversed. reverseScanr :: (Char -> Char -> Char) -> Char -> Stream Char -> Stream Char -- | O(n) Like a combination of map and foldl. Applies -- a function to each element of a stream, passing an accumulating -- parameter from left to right, and returns a final stream. -- -- Note: Unlike the version over lists, this function does not -- return a final value for the accumulator, because the nature of -- streams precludes it. mapAccumL :: (a -> b -> (a, b)) -> a -> Stream b -> Stream b replicate :: Int -> Char -> Stream Char -- | O(n), where n is the length of the result. The unfoldr -- function is analogous to the List unfoldr. unfoldr builds a -- stream from a seed value. The function takes the element and returns -- Nothing if it is done producing the stream or returns Just (a,b), in -- which case, a is the next Char in the string, and b is the seed value -- for further production. unfoldr :: (a -> Maybe (Char, a)) -> a -> Stream Char -- | 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. unfoldrN :: Int -> (a -> Maybe (Char, a)) -> a -> Stream Char -- | O(n) take n, applied to a stream, returns the prefix of the -- stream of length n, or the stream itself if n is -- greater than the length of the stream. take :: Int -> Stream Char -> Stream Char -- | O(n) drop n, applied to a stream, returns the suffix of the -- stream of length n, or the empty stream if n is -- greater than the length of the stream. drop :: Int -> Stream Char -> Stream Char -- | takeWhile, applied to a predicate p and a stream, returns the -- longest prefix (possibly empty) of elements that satisfy p. takeWhile :: (Char -> Bool) -> Stream Char -> Stream Char -- | dropWhile p xs returns the suffix remaining after takeWhile -- p xs. dropWhile :: (Char -> Bool) -> Stream Char -> Stream Char -- | O(n) The isPrefixOf function takes two Streams -- and returns True iff the first is a prefix of the second. isPrefixOf :: Eq a => Stream a -> Stream a -> Bool -- | O(n) elem is the stream membership predicate. elem :: Char -> Stream Char -> Bool -- | O(n) filter, applied to a predicate and a stream, -- returns a stream containing those characters that satisfy the -- predicate. filter :: (Char -> Bool) -> Stream Char -> Stream Char -- | O(n) The find function takes a predicate and a stream, -- and returns the first element in matching the predicate, or -- Nothing if there is no such element. find :: (Char -> Bool) -> Stream Char -> Maybe Char -- | O(1) stream index (subscript) operator, starting from 0. index :: Stream Char -> Int -> Char -- | The findIndex function takes a predicate and a stream and -- returns the index of the first element in the stream satisfying the -- predicate. findIndex :: (Char -> Bool) -> Stream Char -> Maybe Int -- | The findIndices function takes a predicate and a stream and -- returns all indices of the elements in the stream satisfying the -- predicate. findIndices :: (Char -> Bool) -> Stream Char -> [Int] -- | The findIndexOrEnd function takes a predicate and a stream and -- returns the index of the first element in the stream satisfying the -- predicate. findIndexOrEnd :: (Char -> Bool) -> Stream Char -> Int -- | O(n) The elemIndex function returns the index of the -- first element in the given stream which is equal to the query element, -- or Nothing if there is no such element. elemIndex :: Char -> Stream Char -> Maybe Int -- | O(n) The elemIndices function returns the index of every -- element in the given stream which is equal to the query element. elemIndices :: Char -> Stream Char -> [Int] -- | O(n) The count function returns the number of times the -- query element appears in the given stream. count :: Char -> Stream Char -> Int -- | zipWith generalises zip by zipping with the function given as -- the first argument, instead of a tupling function. zipWith :: (Char -> Char -> Char) -> Stream Char -> Stream Char -> Stream Char -- | Fusible Stream-oriented functions for converting between -- Text and several common encodings. module Data.Text.Encoding.Fusion streamASCII :: ByteString -> Stream Char -- | O(n) Convert a ByteString into a 'Stream Char', using -- UTF-8 encoding. streamUtf8 :: ByteString -> Stream Char -- | O(n) Convert a ByteString into a 'Stream Char', using -- little endian UTF-16 encoding. streamUtf16LE :: ByteString -> Stream Char -- | O(n) Convert a ByteString into a 'Stream Char', using -- big endian UTF-16 encoding. streamUtf16BE :: ByteString -> Stream Char -- | O(n) Convert a ByteString into a 'Stream Char', using -- little endian UTF-32 encoding. streamUtf32LE :: ByteString -> Stream Char -- | O(n) Convert a ByteString into a 'Stream Char', using -- big endian UTF-32 encoding. streamUtf32BE :: ByteString -> Stream Char -- | O(n) Convert a Stream Word8 to a -- ByteString. unstream :: Stream Word8 -> ByteString -- | O(n) Convert a Stream Char into a UTF-8 encoded Stream Word8. restreamUtf8 :: Stream Char -> Stream Word8 restreamUtf16LE :: Stream Char -> Stream Word8 restreamUtf16BE :: Stream Char -> Stream Word8 restreamUtf32LE :: Stream Char -> Stream Word8 restreamUtf32BE :: Stream Char -> Stream Word8 instance Eq M instance Ord M instance Show M -- | Functions for converting Text values to and from -- ByteString, using several standard encodings. -- -- To make use of a much larger variety of encodings, use the -- text-icu package. module Data.Text.Encoding -- | Decode a ByteString containing 7-bit ASCII encoded text. decodeASCII :: ByteString -> Text -- | Decode a ByteString containing UTF-8 encoded text. decodeUtf8 :: ByteString -> Text -- | Decode text from little endian UTF-16 encoding. decodeUtf16LE :: ByteString -> Text -- | Decode text from big endian UTF-16 encoding. decodeUtf16BE :: ByteString -> Text -- | Decode text from little endian UTF-32 encoding. decodeUtf32LE :: ByteString -> Text -- | Decode text from big endian UTF-32 encoding. decodeUtf32BE :: ByteString -> Text -- | Encode text using UTF-8 encoding. encodeUtf8 :: Text -> ByteString -- | Encode text using little endian UTF-16 encoding. encodeUtf16LE :: Text -> ByteString -- | Encode text using big endian UTF-16 encoding. encodeUtf16BE :: Text -> ByteString -- | Encode text using little endian UTF-32 encoding. encodeUtf32LE :: Text -> ByteString -- | Encode text using big endian UTF-32 encoding. encodeUtf32BE :: Text -> ByteString -- | Support for using Text data with native code via the Haskell -- foreign function interface. module Data.Text.Foreign -- | O(n) Create a new Text from a Ptr Word16 -- by copying the contents of the array. fromPtr :: Ptr Word16 -> Int -> IO Text -- | O(n) Perform an action on a temporary, mutable copy of a -- Text. The copy is freed as soon as the action returns. useAsPtr :: Text -> (Ptr Word16 -> Int -> IO a) -> IO a -- | O(1) Return the length of a Text in units of -- Word16. This is useful for sizing a target array appropriately -- before using unsafeCopyToPtr. lengthWord16 :: Text -> Int -- | O(n) Copy a Text to an array. The array is assumed to be -- big enough to hold the contents of the entire Text. unsafeCopyToPtr :: Text -> Ptr Word16 -> IO () -- | A time and space-efficient implementation of Unicode text using packed -- Word16 arrays. Suitable for performance critical use, both in terms of -- large data quantities and high speed. -- -- This module is intended to be imported qualified, to avoid -- name clashes with Prelude functions, e.g. -- --
-- import qualified Data.Text as T --module Data.Text -- | A space efficient, packed, unboxed Unicode text type. data Text -- | O(n) Convert a String into a Text. -- -- This function is subject to array fusion. pack :: String -> Text -- | O(n) Convert a Text into a String. Subject to array fusion. unpack :: Text -> String -- | O(1) Convert a character into a Text. Subject to array fusion. singleton :: Char -> Text -- | O(1) The empty Text. empty :: Text -- | O(n) Adds a character to the front of a Text. This -- function is more costly than its List counterpart because it -- requires copying a new array. Subject to array fusion. cons :: Char -> Text -> Text -- | O(n) Adds a character to the end of a Text. This copies -- the entire array in the process. Subject to array fusion. snoc :: Text -> Char -> Text -- | O(n) Appends one Text to the other by copying both of -- them into a new Text. Subject to array fusion. append :: Text -> Text -> Text -- | O(1) Returns the first character and rest of a Text, or -- Nothing if empty. Subject to array fusion. uncons :: Text -> Maybe (Char, Text) -- | O(1) Returns the first character of a Text, which must -- be non-empty. Subject to array fusion. head :: Text -> Char -- | O(1) Returns the last character of a Text, which must be -- non-empty. Subject to array fusion. last :: Text -> Char -- | O(1) Returns all characters after the head of a Text, -- which must be non-empty. Subject to array fusion. tail :: Text -> Text -- | O(1) Returns all but the last character of a Text, which -- must be non-empty. Subject to array fusion. init :: Text -> Text -- | O(1) Tests whether a Text is empty or not. Subject to -- array fusion. null :: Text -> Bool -- | O(n) Returns the number of characters in a Text. Subject -- to array fusion. length :: Text -> Int -- | O(n) map f xs is the Text obtained by -- applying f to each element of xs. Subject to array -- fusion. map :: (Char -> Char) -> Text -> Text -- | O(n) The intercalate function takes a Text and a -- list of Texts and concatenates the list after interspersing the -- first argument between each element of the list. intercalate :: Text -> [Text] -> Text -- | O(n) The intersperse function takes a character and -- places it between the characters of a Text. Subject to array -- fusion. intersperse :: Char -> Text -> Text -- | O(n) The transpose function transposes the rows and -- columns of its Text argument. Note that this function uses -- pack, unpack, and the list version of transpose, and is -- thus not very efficient. transpose :: [Text] -> [Text] -- | O(n) Reverse the characters of a string. Subject to array -- fusion. reverse :: Text -> Text -- | O(n) foldl, applied to a binary operator, a starting -- value (typically the left-identity of the operator), and a -- Text, reduces the Text using the binary operator, from -- left to right. Subject to array fusion. foldl :: (b -> Char -> b) -> b -> Text -> b -- | O(n) A strict version of foldl. Subject to array fusion. foldl' :: (b -> Char -> b) -> b -> Text -> b -- | O(n) A variant of foldl that has no starting value -- argument, and thus must be applied to a non-empty Text. Subject -- to array fusion. foldl1 :: (Char -> Char -> Char) -> Text -> Char -- | O(n) A strict version of foldl1. Subject to array -- fusion. foldl1' :: (Char -> Char -> Char) -> Text -> Char -- | O(n) foldr, applied to a binary operator, a starting -- value (typically the right-identity of the operator), and a -- Text, reduces the Text using the binary operator, from -- right to left. Subject to array fusion. foldr :: (Char -> b -> b) -> b -> Text -> b -- | O(n) A variant of foldr that has no starting value -- argument, and thust must be applied to a non-empty Text. -- Subject to array fusion. foldr1 :: (Char -> Char -> Char) -> Text -> Char -- | O(n) Concatenate a list of Texts. Subject to array -- fusion. concat :: [Text] -> Text -- | O(n) Map a function over a Text that results in a -- Text, and concatenate the results. This function is subject to -- array fusion. -- -- Note: if in concatMap f t, f is -- defined in terms of fusible functions, it will also be fusible. concatMap :: (Char -> Text) -> Text -> Text -- | O(n) any p t determines whether any -- character in the Text t satisifes the predicate -- p. Subject to array fusion. any :: (Char -> Bool) -> Text -> Bool -- | O(n) all p t determines whether all -- characters in the Text t satisify the predicate -- p. Subject to array fusion. all :: (Char -> Bool) -> Text -> Bool -- | O(n) maximum returns the maximum value from a -- Text, which must be non-empty. Subject to array fusion. maximum :: Text -> Char -- | O(n) minimum returns the minimum value from a -- Text, which must be non-empty. Subject to array fusion. minimum :: Text -> Char -- | O(n) scanl is similar to foldl, but returns a -- list of successive reduced values from the left. This function is -- subject to array fusion. -- --
-- scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...] ---- -- Note that -- --
-- last (scanl f z xs) == foldl f z xs. --scanl :: (Char -> Char -> Char) -> Char -> Text -> Text -- | O(n) scanl1 is a variant of scanl that has no -- starting value argument. This function is subject to array fusion. -- --
-- scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] --scanl1 :: (Char -> Char -> Char) -> Text -> Text -- | O(n) scanr is the right-to-left dual of scanl. -- --
-- scanr f v t == reverse (scanl (flip f) v t) --scanr :: (Char -> Char -> Char) -> Char -> Text -> Text -- | O(n) scanr1 is a variant of scanr that has no -- starting value argument. This function is subject to array fusion. scanr1 :: (Char -> Char -> Char) -> Text -> Text -- | O(n) Like a combination of map and foldl. Applies -- a function to each element of a Text, passing an accumulating -- parameter from left to right, and returns a final Text. mapAccumL :: (a -> Char -> (a, Char)) -> a -> Text -> (a, Text) -- | The mapAccumR function behaves like a combination of map -- and foldr; it applies a function to each element of a -- Text, passing an accumulating parameter from right to left, and -- returning a final value of this accumulator together with the new -- Text. mapAccumR :: (a -> Char -> (a, Char)) -> a -> Text -> (a, Text) -- | O(n) replicate n c is a Text of -- length n with c the value of every element. replicate :: Int -> Char -> Text -- | O(n), where n is the length of the result. The -- unfoldr function is analogous to the List unfoldr. -- unfoldr builds a Text from a seed value. The function -- takes the element and returns Nothing if it is done producing -- the Text, otherwise Just (a,b). In this case, -- a is the next Char in the string, and b is -- the seed value for further production. unfoldr :: (a -> Maybe (Char, a)) -> a -> Text -- | O(n) Like unfoldr, unfoldrN builds a Text -- from a seed value. However, the length of the result should be limited -- by the first argument to unfoldrN. This function is more -- efficient than unfoldr when the maximum length of the result is -- known and correct, otherwise its performance is similar to -- unfoldr. unfoldrN :: Int -> (a -> Maybe (Char, a)) -> a -> Text -- | O(n) take n, applied to a Text, returns -- the prefix of the Text of length n, or the Text -- itself if n is greater than the length of the Text. take :: Int -> Text -> Text -- | O(n) drop n, applied to a Text, returns -- the suffix of the Text of length n, or the empty -- Text if n is greater than the length of the -- Text. drop :: Int -> Text -> Text -- | O(n) takeWhile, applied to a predicate p and a -- Text, returns the longest prefix (possibly empty) of elements -- that satisfy p. This function is subject to array fusion. takeWhile :: (Char -> Bool) -> Text -> Text -- | O(n) dropWhile p xs returns the suffix -- remaining after takeWhile p xs. This function -- is subject to array fusion. dropWhile :: (Char -> Bool) -> Text -> Text -- | O(n) splitAt n t returns a pair whose first -- element is a prefix of t of length n, and whose -- second is the remainder of the string. It is equivalent to -- (take n t, drop n t). splitAt :: Int -> Text -> (Text, Text) -- | O(n) span, applied to a predicate p and text -- t, returns a pair whose first element is the longest prefix -- (possibly empty) of t of elements that satisfy p, -- and whose second is the remainder of the list. span :: (Char -> Bool) -> Text -> (Text, Text) -- | O(n) break is like span, but the prefix returned -- is over elements that fail the predicate p. break :: (Char -> Bool) -> Text -> (Text, Text) -- | O(n) Group characters in a string by equality. group :: Text -> [Text] -- | O(n) Group characters in a string according to a predicate. groupBy :: (Char -> Char -> Bool) -> Text -> [Text] -- | O(n) Return all initial segments of the given Text, -- shortest first. inits :: Text -> [Text] -- | O(n) Return all final segments of the given Text, -- longest first. tails :: Text -> [Text] -- | O(n) Break a Text into pieces separated by the -- Char argument, consuming the delimiter. I.e. -- --
-- split '\n' "a\nb\nd\ne" == ["a","b","d","e"] -- split 'a' "aXaXaXa" == ["","X","X","X",""] -- split 'x' "x" == ["",""] ---- -- and -- --
-- intercalate (singleton c) . split c == id -- split == splitWith . (==) ---- -- As for all splitting functions in this library, this function does not -- copy the substrings, it just constructs new Texts that are -- slices of the original. split :: Char -> Text -> [Text] -- | O(n) Splits a Text into components delimited by -- separators, where the predicate returns True for a separator element. -- The resulting components do not contain the separators. Two adjacent -- separators result in an empty component in the output. eg. -- --
-- splitWith (=='a') "aabbaca" == ["","","bb","c",""] -- splitWith (=='a') [] == [] --splitWith :: (Char -> Bool) -> Text -> [Text] -- | O(n) Break a string on a substring, returning a pair of the -- part of the string prior to the match, and the rest of the string. -- -- The following relationship holds: -- --
-- break (==c) l == breakSubstring (singleton c) l ---- -- For example, to tokenise a string, dropping delimiters: -- --
-- tokenise x y = h : if null t then [] else tokenise x (drop (length x) t) -- where (h,t) = breakSubstring x y ---- -- To skip to the first occurence of a string: -- --
-- snd (breakSubstring x y) ---- -- To take the parts of a string before a delimiter: -- --
-- fst (breakSubstring x y) --breakSubstring :: Text -> Text -> (Text, Text) -- | O(n) Breaks a Text up into a list of Texts at -- newline Chars. The resulting strings do not contain newlines. lines :: Text -> [Text] -- | O(n) Breaks a Text up into a list of words, delimited by -- Chars representing white space. words :: Text -> [Text] -- | O(n) Portably breaks a Text up into a list of -- Texts at line boundaries. -- -- A line boundary is considered to be either a line feed, a carriage -- return immediately followed by a line feed, or a carriage return. This -- accounts for both Unix and Windows line ending conventions, and for -- the old convention used on Mac OS 9 and earlier. -- -- O(n) Joins lines, after appending a terminating newline to -- each. unlines :: [Text] -> Text -- | O(n) Joins words using single space characters. unwords :: [Text] -> Text -- | O(n) The isPrefixOf function takes two Texts and -- returns True iff the first is a prefix of the second. This -- function is subject to fusion. isPrefixOf :: Text -> Text -> Bool -- | O(n) The isSuffixOf function takes two Texts and -- returns True iff the first is a suffix of the second. isSuffixOf :: Text -> Text -> Bool -- | O(n) The isInfixOf function takes two Texts and -- returns True iff the first is contained, wholly and intact, -- anywhere within the second. isInfixOf :: Text -> Text -> Bool -- | O(n) elem is the Text membership predicate. elem :: Char -> Text -> Bool -- | O(n) filter, applied to a predicate and a Text, -- returns a Text containing those characters that satisfy the -- predicate. filter :: (Char -> Bool) -> Text -> Text -- | O(n) The find function takes a predicate and a -- Text, and returns the first element in matching the predicate, -- or Nothing if there is no such element. find :: (Char -> Bool) -> Text -> Maybe Char -- | O(n) The partition function takes a predicate and a -- Text, and returns the pair of Texts with elements which -- do and do not satisfy the predicate, respectively; i.e. -- --
-- partition p t == (filter p t, filter (not . p) t) --partition :: (Char -> Bool) -> Text -> (Text, Text) -- | O(1) Text index (subscript) operator, starting from 0. index :: Text -> Int -> Char -- | O(n) The findIndex function takes a predicate and a -- Text and returns the index of the first element in the -- Text satisfying the predicate. This function is subject to -- fusion. findIndex :: (Char -> Bool) -> Text -> Maybe Int -- | The findIndices function extends findIndex, by returning -- the indices of all elements satisfying the predicate, in ascending -- order. This function is subject to fusion. findIndices :: (Char -> Bool) -> Text -> [Int] -- | O(n) The elemIndex function returns the index of the -- first element in the given Text which is equal to the query -- element, or Nothing if there is no such element. This function -- is subject to fusion. elemIndex :: Char -> Text -> Maybe Int -- | O(n) The elemIndices function returns the index of every -- element in the given Text which is equal to the query element. -- This function is subject to fusion. elemIndices :: Char -> Text -> [Int] -- | O(n) The count function returns the number of times the -- query element appears in the given Text. This function is -- subject to fusion. count :: Char -> Text -> Int -- | O(n) zipWith generalises zip by zipping with -- the function given as the first argument, instead of a tupling -- function. zipWith :: (Char -> Char -> Char) -> Text -> Text -> Text instance IsString Text instance Monoid Text instance Read Text instance Show Text instance Eq Text