tagsoup-0.10: Parsing and extracting information from (possibly malformed) HTML/XML documentsSource codeContentsIndex
Text.StringLike
Description

WARNING: This module is not intended for use outside the TagSoup library.

This module provides an abstraction for String's as used inside TagSoup. It allows TagSoup to work with String (list of Char), ByteString.Char8 and ByteString.Lazy.Char8.

Synopsis
class (Typeable a, Eq a) => StringLike a where
empty :: a
cons :: Char -> a -> a
uncons :: a -> Maybe (Char, a)
toString :: a -> String
fromString :: String -> a
fromChar :: Char -> a
strConcat :: [a] -> a
strNull :: a -> Bool
append :: a -> a -> a
castString :: (StringLike a, StringLike b) => a -> b
Documentation
class (Typeable a, Eq a) => StringLike a whereSource
A class to generalise TagSoup parsing over many types of string-like types. Examples are given for the String type.
Methods
empty :: aSource
 empty = ""
cons :: Char -> a -> aSource
 cons = (:)
uncons :: a -> Maybe (Char, a)Source
 uncons []     = Nothing
 uncons (x:xs) = Just (x, xs)
toString :: a -> StringSource
 toString = id
fromString :: String -> aSource
 fromString = id
fromChar :: Char -> aSource
 fromChar = return
strConcat :: [a] -> aSource
 strConcat = concat
strNull :: a -> BoolSource
 strNull = null
append :: a -> a -> aSource
 append = (++)
castString :: (StringLike a, StringLike b) => a -> bSource
Convert a String from one type to another.
Produced by Haddock version 2.6.1