Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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, ByteString.Lazy.Char8, Data.Text and Data.Text.Lazy.
- class (Typeable a, Eq a, IsString a) => StringLike a where
- fromString :: IsString a => String -> a
- castString :: (StringLike a, StringLike b) => a -> b
Documentation
class (Typeable a, Eq a, IsString a) => StringLike a where Source #
A class to generalise TagSoup parsing over many types of string-like types. Examples are given for the String type.
empty = ""
cons :: Char -> a -> a Source #
cons = (:)
uncons :: a -> Maybe (Char, a) Source #
uncons [] = Nothing uncons (x:xs) = Just (x, xs)
toString :: a -> String Source #
toString = id
fromChar :: Char -> a Source #
fromChar = return
strConcat :: [a] -> a Source #
strConcat = concat
strNull = null
append :: a -> a -> a Source #
append = (++)
fromString :: IsString a => String -> a #
castString :: (StringLike a, StringLike b) => a -> b Source #
Convert a String from one type to another.