ListLike-4.7.8.4: Generalized support for list-like structures

Copyright | Copyright (C) 2007 John Goerzen
License | BSD3
Maintainer | David Fox <dsf@seereason.com>, Andreas Abel
Stability | stable
Portability | portable
Safe Haskell | None
Language | Haskell2010

Data.ListLike.CharString

Description

Newtype wrapper for ByteString to enable a Char-based interface Re-exported by Data.ListLike.

Written by John Lato, jwlato@gmail.com

Synopsis

- newtype CharString = CS {
  - unCS :: ByteString
  }
- newtype CharStringLazy = CSL {
  - unCSL :: ByteString
  }

# Documentation

newtype CharString Source #

Newtype wrapper around Data.ByteString.Char8.ByteString, this allows for ListLike instances with Char elements.

Constructors

CS |

Fields

- unCS :: ByteString

#### Instances

Instances details

StringLike CharString Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

toString :: CharString -> String Source #

lines :: ListLike full CharString => CharString -> full Source #

words :: ListLike full CharString => CharString -> full Source #

unlines :: ListLike full CharString => full -> CharString Source #

unwords :: ListLike full CharString => full -> CharString Source #

show :: Show a => a -> CharString Source #

fromStringLike :: StringLike s' => CharString -> s' Source #

fromText :: Text -> CharString Source #

fromLazyText :: Text -> CharString Source #

Monoid CharString Source # |
Instance details Defined in Data.ListLike.CharString Methods mempty :: CharString Source # mappend :: CharString -> CharString -> CharString Source # mconcat :: [CharString] -> CharString Source #
Semigroup CharString Source # |
Instance details Defined in Data.ListLike.CharString Methods (<>) :: CharString -> CharString -> CharString Source # sconcat :: NonEmpty CharString -> CharString Source # stimes :: Integral b => b -> CharString -> CharString Source #
IsString CharString Source # |
Instance details Defined in Data.ListLike.CharString Methods fromString :: String -> CharString Source #
IsList CharString Source # |

Instance details

Defined in Data.ListLike.CharString

Associated Types

type Item CharString |
Instance details Defined in Data.ListLike.CharString type Item CharString = Char

Methods

fromList :: [Item CharString] -> CharString Source #

fromListN :: Int -> [Item CharString] -> CharString Source #

toList :: CharString -> [Item CharString] Source #

Read CharString Source # |
Instance details Defined in Data.ListLike.CharString Methods readsPrec :: Int -> ReadS CharString Source # readList :: ReadS [CharString] Source # readPrec :: ReadPrec CharString Source # readListPrec :: ReadPrec [CharString] Source #
Show CharString Source # |
Instance details Defined in Data.ListLike.CharString Methods showsPrec :: Int -> CharString -> ShowS Source # show :: CharString -> String Source # showList :: [CharString] -> ShowS Source #
Eq CharString Source # |
Instance details Defined in Data.ListLike.CharString Methods (==) :: CharString -> CharString -> Bool Source # (/=) :: CharString -> CharString -> Bool Source #
Ord CharString Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

compare :: CharString -> CharString -> Ordering Source #

(<) :: CharString -> CharString -> Bool Source #

(<=) :: CharString -> CharString -> Bool Source #

(>) :: CharString -> CharString -> Bool Source #

(>=) :: CharString -> CharString -> Bool Source #

max :: CharString -> CharString -> CharString Source #

min :: CharString -> CharString -> CharString Source #

ListLike CharString Char Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

empty :: CharString Source #

singleton :: Char -> CharString Source #

cons :: Char -> CharString -> CharString Source #

snoc :: CharString -> Char -> CharString Source #

append :: CharString -> CharString -> CharString Source #

head :: CharString -> Char Source #

uncons :: CharString -> Maybe (Char, CharString) Source #

last :: CharString -> Char Source #

tail :: CharString -> CharString Source #

init :: CharString -> CharString Source #

null :: CharString -> Bool Source #

length :: CharString -> Int Source #

map :: ListLike full' item' => (Char -> item') -> CharString -> full' Source #

rigidMap :: (Char -> Char) -> CharString -> CharString Source #

reverse :: CharString -> CharString Source #

intersperse :: Char -> CharString -> CharString Source #

concat :: ListLike full' CharString => full' -> CharString Source #

concatMap :: ListLike full' item' => (Char -> full') -> CharString -> full' Source #

rigidConcatMap :: (Char -> CharString) -> CharString -> CharString Source #

any :: (Char -> Bool) -> CharString -> Bool Source #

all :: (Char -> Bool) -> CharString -> Bool Source #

maximum :: CharString -> Char Source #

minimum :: CharString -> Char Source #

replicate :: Int -> Char -> CharString Source #

take :: Int -> CharString -> CharString Source #

drop :: Int -> CharString -> CharString Source #

splitAt :: Int -> CharString -> (CharString, CharString) Source #

takeWhile :: (Char -> Bool) -> CharString -> CharString Source #

dropWhile :: (Char -> Bool) -> CharString -> CharString Source #

dropWhileEnd :: (Char -> Bool) -> CharString -> CharString Source #

span :: (Char -> Bool) -> CharString -> (CharString, CharString) Source #

break :: (Char -> Bool) -> CharString -> (CharString, CharString) Source #

group :: (ListLike full' CharString, Eq Char) => CharString -> full' Source #

inits :: ListLike full' CharString => CharString -> full' Source #

tails :: ListLike full' CharString => CharString -> full' Source #

isPrefixOf :: CharString -> CharString -> Bool Source #

isSuffixOf :: CharString -> CharString -> Bool Source #

isInfixOf :: CharString -> CharString -> Bool Source #

stripPrefix :: CharString -> CharString -> Maybe CharString Source #

stripSuffix :: CharString -> CharString -> Maybe CharString Source #

elem :: Char -> CharString -> Bool Source #

notElem :: Char -> CharString -> Bool Source #

find :: (Char -> Bool) -> CharString -> Maybe Char Source #

filter :: (Char -> Bool) -> CharString -> CharString Source #

partition :: (Char -> Bool) -> CharString -> (CharString, CharString) Source #

index :: CharString -> Int -> Char Source #

elemIndex :: Char -> CharString -> Maybe Int Source #

elemIndices :: (Eq Char, ListLike result Int) => Char -> CharString -> result Source #

findIndex :: (Char -> Bool) -> CharString -> Maybe Int Source #

findIndices :: ListLike result Int => (Char -> Bool) -> CharString -> result Source #

sequence :: (Applicative m, ListLike fullinp (m Char)) => fullinp -> m CharString Source #

mapM :: (Applicative m, ListLike full' item') => (Char -> m item') -> CharString -> m full' Source #

rigidMapM :: Monad m => (Char -> m Char) -> CharString -> m CharString Source #

nub :: CharString -> CharString Source #

delete :: Char -> CharString -> CharString Source #

deleteFirsts :: CharString -> CharString -> CharString Source #

union :: CharString -> CharString -> CharString Source #

intersect :: CharString -> CharString -> CharString Source #

sort :: CharString -> CharString Source #

insert :: Char -> CharString -> CharString Source #

toList' :: CharString -> [Char] Source #

fromList' :: [Char] -> CharString Source #

fromListLike :: ListLike full' Char => CharString -> full' Source #

nubBy :: (Char -> Char -> Bool) -> CharString -> CharString Source #

deleteBy :: (Char -> Char -> Bool) -> Char -> CharString -> CharString Source #

deleteFirstsBy :: (Char -> Char -> Bool) -> CharString -> CharString -> CharString Source #

unionBy :: (Char -> Char -> Bool) -> CharString -> CharString -> CharString Source #

intersectBy :: (Char -> Char -> Bool) -> CharString -> CharString -> CharString Source #

groupBy :: (ListLike full' CharString, Eq Char) => (Char -> Char -> Bool) -> CharString -> full' Source #

sortBy :: (Char -> Char -> Ordering) -> CharString -> CharString Source #

insertBy :: (Char -> Char -> Ordering) -> Char -> CharString -> CharString Source #

genericLength :: Num a => CharString -> a Source #

genericTake :: Integral a => a -> CharString -> CharString Source #

genericDrop :: Integral a => a -> CharString -> CharString Source #

genericSplitAt :: Integral a => a -> CharString -> (CharString, CharString) Source #

genericReplicate :: Integral a => a -> Char -> CharString Source #

FoldableLL CharString Char Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

foldl :: (a -> Char -> a) -> a -> CharString -> a Source #

foldl' :: (a -> Char -> a) -> a -> CharString -> a Source #

foldl1 :: (Char -> Char -> Char) -> CharString -> Char Source #

foldr :: (Char -> b -> b) -> b -> CharString -> b Source #

foldr' :: (Char -> b -> b) -> b -> CharString -> b Source #

foldr1 :: (Char -> Char -> Char) -> CharString -> Char Source #

ListLikeIO CharString Char Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

hGetLine :: Handle -> IO CharString Source #

hGetContents :: Handle -> IO CharString Source #

hGet :: Handle -> Int -> IO CharString Source #

hGetNonBlocking :: Handle -> Int -> IO CharString Source #

hPutStr :: Handle -> CharString -> IO () Source #

hPutStrLn :: Handle -> CharString -> IO () Source #

getLine :: IO CharString Source #

getContents :: IO CharString Source #

putStr :: CharString -> IO () Source #

putStrLn :: CharString -> IO () Source #

interact :: (CharString -> CharString) -> IO () Source #

readFile :: FilePath -> IO CharString Source #

writeFile :: FilePath -> CharString -> IO () Source #

appendFile :: FilePath -> CharString -> IO () Source #

type Item CharString Source # |
Instance details Defined in Data.ListLike.CharString type Item CharString = Char

newtype CharStringLazy Source #

Newtype wrapper around Data.ByteString.Lazy.Char8.ByteString, this allows for ListLike instances with Char elements.

Constructors

CSL |

Fields

- unCSL :: ByteString

#### Instances

Instances details

StringLike CharStringLazy Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

toString :: CharStringLazy -> String Source #

lines :: ListLike full CharStringLazy => CharStringLazy -> full Source #

words :: ListLike full CharStringLazy => CharStringLazy -> full Source #

unlines :: ListLike full CharStringLazy => full -> CharStringLazy Source #

unwords :: ListLike full CharStringLazy => full -> CharStringLazy Source #

show :: Show a => a -> CharStringLazy Source #

fromStringLike :: StringLike s' => CharStringLazy -> s' Source #

fromText :: Text -> CharStringLazy Source #

fromLazyText :: Text -> CharStringLazy Source #

Monoid CharStringLazy Source # |
Instance details Defined in Data.ListLike.CharString Methods mempty :: CharStringLazy Source # mappend :: CharStringLazy -> CharStringLazy -> CharStringLazy Source # mconcat :: [CharStringLazy] -> CharStringLazy Source #
Semigroup CharStringLazy Source # |
Instance details Defined in Data.ListLike.CharString Methods (<>) :: CharStringLazy -> CharStringLazy -> CharStringLazy Source # sconcat :: NonEmpty CharStringLazy -> CharStringLazy Source # stimes :: Integral b => b -> CharStringLazy -> CharStringLazy Source #
IsString CharStringLazy Source # |
Instance details Defined in Data.ListLike.CharString Methods fromString :: String -> CharStringLazy Source #
IsList CharStringLazy Source # |

Instance details

Defined in Data.ListLike.CharString

Associated Types

type Item CharStringLazy |
Instance details Defined in Data.ListLike.CharString type Item CharStringLazy = Char

Methods

fromList :: [Item CharStringLazy] -> CharStringLazy Source #

fromListN :: Int -> [Item CharStringLazy] -> CharStringLazy Source #

toList :: CharStringLazy -> [Item CharStringLazy] Source #

Read CharStringLazy Source # |
Instance details Defined in Data.ListLike.CharString Methods readsPrec :: Int -> ReadS CharStringLazy Source # readList :: ReadS [CharStringLazy] Source # readPrec :: ReadPrec CharStringLazy Source # readListPrec :: ReadPrec [CharStringLazy] Source #
Show CharStringLazy Source # |
Instance details Defined in Data.ListLike.CharString Methods showsPrec :: Int -> CharStringLazy -> ShowS Source # show :: CharStringLazy -> String Source # showList :: [CharStringLazy] -> ShowS Source #
Eq CharStringLazy Source # |
Instance details Defined in Data.ListLike.CharString Methods (==) :: CharStringLazy -> CharStringLazy -> Bool Source # (/=) :: CharStringLazy -> CharStringLazy -> Bool Source #
Ord CharStringLazy Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

compare :: CharStringLazy -> CharStringLazy -> Ordering Source #

(<) :: CharStringLazy -> CharStringLazy -> Bool Source #

(<=) :: CharStringLazy -> CharStringLazy -> Bool Source #

(>) :: CharStringLazy -> CharStringLazy -> Bool Source #

(>=) :: CharStringLazy -> CharStringLazy -> Bool Source #

max :: CharStringLazy -> CharStringLazy -> CharStringLazy Source #

min :: CharStringLazy -> CharStringLazy -> CharStringLazy Source #

ListLike CharStringLazy Char Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

empty :: CharStringLazy Source #

singleton :: Char -> CharStringLazy Source #

cons :: Char -> CharStringLazy -> CharStringLazy Source #

snoc :: CharStringLazy -> Char -> CharStringLazy Source #

append :: CharStringLazy -> CharStringLazy -> CharStringLazy Source #

head :: CharStringLazy -> Char Source #

uncons :: CharStringLazy -> Maybe (Char, CharStringLazy) Source #

last :: CharStringLazy -> Char Source #

tail :: CharStringLazy -> CharStringLazy Source #

init :: CharStringLazy -> CharStringLazy Source #

null :: CharStringLazy -> Bool Source #

length :: CharStringLazy -> Int Source #

map :: ListLike full' item' => (Char -> item') -> CharStringLazy -> full' Source #

rigidMap :: (Char -> Char) -> CharStringLazy -> CharStringLazy Source #

reverse :: CharStringLazy -> CharStringLazy Source #

intersperse :: Char -> CharStringLazy -> CharStringLazy Source #

concat :: ListLike full' CharStringLazy => full' -> CharStringLazy Source #

concatMap :: ListLike full' item' => (Char -> full') -> CharStringLazy -> full' Source #

rigidConcatMap :: (Char -> CharStringLazy) -> CharStringLazy -> CharStringLazy Source #

any :: (Char -> Bool) -> CharStringLazy -> Bool Source #

all :: (Char -> Bool) -> CharStringLazy -> Bool Source #

maximum :: CharStringLazy -> Char Source #

minimum :: CharStringLazy -> Char Source #

replicate :: Int -> Char -> CharStringLazy Source #

take :: Int -> CharStringLazy -> CharStringLazy Source #

drop :: Int -> CharStringLazy -> CharStringLazy Source #

splitAt :: Int -> CharStringLazy -> (CharStringLazy, CharStringLazy) Source #

takeWhile :: (Char -> Bool) -> CharStringLazy -> CharStringLazy Source #

dropWhile :: (Char -> Bool) -> CharStringLazy -> CharStringLazy Source #

dropWhileEnd :: (Char -> Bool) -> CharStringLazy -> CharStringLazy Source #

span :: (Char -> Bool) -> CharStringLazy -> (CharStringLazy, CharStringLazy) Source #

break :: (Char -> Bool) -> CharStringLazy -> (CharStringLazy, CharStringLazy) Source #

group :: (ListLike full' CharStringLazy, Eq Char) => CharStringLazy -> full' Source #

inits :: ListLike full' CharStringLazy => CharStringLazy -> full' Source #

tails :: ListLike full' CharStringLazy => CharStringLazy -> full' Source #

isPrefixOf :: CharStringLazy -> CharStringLazy -> Bool Source #

isSuffixOf :: CharStringLazy -> CharStringLazy -> Bool Source #

isInfixOf :: CharStringLazy -> CharStringLazy -> Bool Source #

stripPrefix :: CharStringLazy -> CharStringLazy -> Maybe CharStringLazy Source #

stripSuffix :: CharStringLazy -> CharStringLazy -> Maybe CharStringLazy Source #

elem :: Char -> CharStringLazy -> Bool Source #

notElem :: Char -> CharStringLazy -> Bool Source #

find :: (Char -> Bool) -> CharStringLazy -> Maybe Char Source #

filter :: (Char -> Bool) -> CharStringLazy -> CharStringLazy Source #

partition :: (Char -> Bool) -> CharStringLazy -> (CharStringLazy, CharStringLazy) Source #

index :: CharStringLazy -> Int -> Char Source #

elemIndex :: Char -> CharStringLazy -> Maybe Int Source #

elemIndices :: (Eq Char, ListLike result Int) => Char -> CharStringLazy -> result Source #

findIndex :: (Char -> Bool) -> CharStringLazy -> Maybe Int Source #

findIndices :: ListLike result Int => (Char -> Bool) -> CharStringLazy -> result Source #

sequence :: (Applicative m, ListLike fullinp (m Char)) => fullinp -> m CharStringLazy Source #

mapM :: (Applicative m, ListLike full' item') => (Char -> m item') -> CharStringLazy -> m full' Source #

rigidMapM :: Monad m => (Char -> m Char) -> CharStringLazy -> m CharStringLazy Source #

nub :: CharStringLazy -> CharStringLazy Source #

delete :: Char -> CharStringLazy -> CharStringLazy Source #

deleteFirsts :: CharStringLazy -> CharStringLazy -> CharStringLazy Source #

union :: CharStringLazy -> CharStringLazy -> CharStringLazy Source #

intersect :: CharStringLazy -> CharStringLazy -> CharStringLazy Source #

sort :: CharStringLazy -> CharStringLazy Source #

insert :: Char -> CharStringLazy -> CharStringLazy Source #

toList' :: CharStringLazy -> [Char] Source #

fromList' :: [Char] -> CharStringLazy Source #

fromListLike :: ListLike full' Char => CharStringLazy -> full' Source #

nubBy :: (Char -> Char -> Bool) -> CharStringLazy -> CharStringLazy Source #

deleteBy :: (Char -> Char -> Bool) -> Char -> CharStringLazy -> CharStringLazy Source #

deleteFirstsBy :: (Char -> Char -> Bool) -> CharStringLazy -> CharStringLazy -> CharStringLazy Source #

unionBy :: (Char -> Char -> Bool) -> CharStringLazy -> CharStringLazy -> CharStringLazy Source #

intersectBy :: (Char -> Char -> Bool) -> CharStringLazy -> CharStringLazy -> CharStringLazy Source #

groupBy :: (ListLike full' CharStringLazy, Eq Char) => (Char -> Char -> Bool) -> CharStringLazy -> full' Source #

sortBy :: (Char -> Char -> Ordering) -> CharStringLazy -> CharStringLazy Source #

insertBy :: (Char -> Char -> Ordering) -> Char -> CharStringLazy -> CharStringLazy Source #

genericLength :: Num a => CharStringLazy -> a Source #

genericTake :: Integral a => a -> CharStringLazy -> CharStringLazy Source #

genericDrop :: Integral a => a -> CharStringLazy -> CharStringLazy Source #

genericSplitAt :: Integral a => a -> CharStringLazy -> (CharStringLazy, CharStringLazy) Source #

genericReplicate :: Integral a => a -> Char -> CharStringLazy Source #

FoldableLL CharStringLazy Char Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

foldl :: (a -> Char -> a) -> a -> CharStringLazy -> a Source #

foldl' :: (a -> Char -> a) -> a -> CharStringLazy -> a Source #

foldl1 :: (Char -> Char -> Char) -> CharStringLazy -> Char Source #

foldr :: (Char -> b -> b) -> b -> CharStringLazy -> b Source #

foldr' :: (Char -> b -> b) -> b -> CharStringLazy -> b Source #

foldr1 :: (Char -> Char -> Char) -> CharStringLazy -> Char Source #

ListLikeIO CharStringLazy Char Source # |

Instance details

Defined in Data.ListLike.CharString

Methods

hGetLine :: Handle -> IO CharStringLazy Source #

hGetContents :: Handle -> IO CharStringLazy Source #

hGet :: Handle -> Int -> IO CharStringLazy Source #

hGetNonBlocking :: Handle -> Int -> IO CharStringLazy Source #

hPutStr :: Handle -> CharStringLazy -> IO () Source #

hPutStrLn :: Handle -> CharStringLazy -> IO () Source #

getLine :: IO CharStringLazy Source #

getContents :: IO CharStringLazy Source #

putStr :: CharStringLazy -> IO () Source #

putStrLn :: CharStringLazy -> IO () Source #

interact :: (CharStringLazy -> CharStringLazy) -> IO () Source #

readFile :: FilePath -> IO CharStringLazy Source #

writeFile :: FilePath -> CharStringLazy -> IO () Source #

appendFile :: FilePath -> CharStringLazy -> IO () Source #

type Item CharStringLazy Source # |
Instance details Defined in Data.ListLike.CharString type Item CharStringLazy = Char