tagsoup-0.12.1: Parsing and extracting information from (possibly malformed) HTML/XML documents

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

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.