ListLike-4.7.8.2: 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 #

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 # |
Instance details Defined in Data.ListLike.CharString Methods toString :: CharString -> String # lines :: ListLike full CharString => CharString -> full # words :: ListLike full CharString => CharString -> full # unlines :: ListLike full CharString => full -> CharString # unwords :: ListLike full CharString => full -> CharString # show :: Show a => a -> CharString # fromStringLike :: StringLike s' => CharString -> s' # fromText :: Text -> CharString # fromLazyText :: Text -> CharString #
IsString CharString # |
Instance details Defined in Data.ListLike.CharString Methods fromString :: String -> CharString #
Monoid CharString # |
Instance details Defined in Data.ListLike.CharString Methods mempty :: CharString # mappend :: CharString -> CharString -> CharString # mconcat :: [CharString] -> CharString #
Semigroup CharString # |
Instance details Defined in Data.ListLike.CharString Methods (<>) :: CharString -> CharString -> CharString # sconcat :: NonEmpty CharString -> CharString # stimes :: Integral b => b -> CharString -> CharString #
IsList CharString # |
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 # fromListN :: Int -> [Item CharString] -> CharString # toList :: CharString -> [Item CharString] #
Read CharString # |
Instance details Defined in Data.ListLike.CharString Methods readsPrec :: Int -> ReadS CharString # readList :: ReadS [CharString] # readPrec :: ReadPrec CharString # readListPrec :: ReadPrec [CharString] #
Show CharString # |
Instance details Defined in Data.ListLike.CharString Methods showsPrec :: Int -> CharString -> ShowS # show :: CharString -> String # showList :: [CharString] -> ShowS #
Eq CharString # |
Instance details Defined in Data.ListLike.CharString Methods (==) :: CharString -> CharString -> Bool # (/=) :: CharString -> CharString -> Bool #
Ord CharString # |
Instance details Defined in Data.ListLike.CharString Methods compare :: CharString -> CharString -> Ordering # (<) :: CharString -> CharString -> Bool # (<=) :: CharString -> CharString -> Bool # (>) :: CharString -> CharString -> Bool # (>=) :: CharString -> CharString -> Bool # max :: CharString -> CharString -> CharString # min :: CharString -> CharString -> CharString #
ListLike CharString Char # |
Instance details Defined in Data.ListLike.CharString Methods empty :: CharString # singleton :: Char -> CharString # cons :: Char -> CharString -> CharString # snoc :: CharString -> Char -> CharString # append :: CharString -> CharString -> CharString # head :: CharString -> Char # uncons :: CharString -> Maybe (Char, CharString) # last :: CharString -> Char # tail :: CharString -> CharString # init :: CharString -> CharString # null :: CharString -> Bool # length :: CharString -> Int # map :: ListLike full' item' => (Char -> item') -> CharString -> full' # rigidMap :: (Char -> Char) -> CharString -> CharString # reverse :: CharString -> CharString # intersperse :: Char -> CharString -> CharString # concat :: ListLike full' CharString => full' -> CharString # concatMap :: ListLike full' item' => (Char -> full') -> CharString -> full' # rigidConcatMap :: (Char -> CharString) -> CharString -> CharString # any :: (Char -> Bool) -> CharString -> Bool # all :: (Char -> Bool) -> CharString -> Bool # maximum :: CharString -> Char # minimum :: CharString -> Char # replicate :: Int -> Char -> CharString # take :: Int -> CharString -> CharString # drop :: Int -> CharString -> CharString # splitAt :: Int -> CharString -> (CharString, CharString) # takeWhile :: (Char -> Bool) -> CharString -> CharString # dropWhile :: (Char -> Bool) -> CharString -> CharString # dropWhileEnd :: (Char -> Bool) -> CharString -> CharString # span :: (Char -> Bool) -> CharString -> (CharString, CharString) # break :: (Char -> Bool) -> CharString -> (CharString, CharString) # group :: (ListLike full' CharString, Eq Char) => CharString -> full' # inits :: ListLike full' CharString => CharString -> full' # tails :: ListLike full' CharString => CharString -> full' # isPrefixOf :: CharString -> CharString -> Bool # isSuffixOf :: CharString -> CharString -> Bool # isInfixOf :: CharString -> CharString -> Bool # stripPrefix :: CharString -> CharString -> Maybe CharString # stripSuffix :: CharString -> CharString -> Maybe CharString # elem :: Char -> CharString -> Bool # notElem :: Char -> CharString -> Bool # find :: (Char -> Bool) -> CharString -> Maybe Char # filter :: (Char -> Bool) -> CharString -> CharString # partition :: (Char -> Bool) -> CharString -> (CharString, CharString) # index :: CharString -> Int -> Char # elemIndex :: Char -> CharString -> Maybe Int # elemIndices :: (Eq Char, ListLike result Int) => Char -> CharString -> result # findIndex :: (Char -> Bool) -> CharString -> Maybe Int # findIndices :: ListLike result Int => (Char -> Bool) -> CharString -> result # sequence :: (Applicative m, ListLike fullinp (m Char)) => fullinp -> m CharString # mapM :: (Applicative m, ListLike full' item') => (Char -> m item') -> CharString -> m full' # rigidMapM :: Monad m => (Char -> m Char) -> CharString -> m CharString # nub :: CharString -> CharString # delete :: Char -> CharString -> CharString # deleteFirsts :: CharString -> CharString -> CharString # union :: CharString -> CharString -> CharString # intersect :: CharString -> CharString -> CharString # sort :: CharString -> CharString # insert :: Char -> CharString -> CharString # toList' :: CharString -> [Char] # fromList' :: [Char] -> CharString # fromListLike :: ListLike full' Char => CharString -> full' # nubBy :: (Char -> Char -> Bool) -> CharString -> CharString # deleteBy :: (Char -> Char -> Bool) -> Char -> CharString -> CharString # deleteFirstsBy :: (Char -> Char -> Bool) -> CharString -> CharString -> CharString # unionBy :: (Char -> Char -> Bool) -> CharString -> CharString -> CharString # intersectBy :: (Char -> Char -> Bool) -> CharString -> CharString -> CharString # groupBy :: (ListLike full' CharString, Eq Char) => (Char -> Char -> Bool) -> CharString -> full' # sortBy :: (Char -> Char -> Ordering) -> CharString -> CharString # insertBy :: (Char -> Char -> Ordering) -> Char -> CharString -> CharString # genericLength :: Num a => CharString -> a # genericTake :: Integral a => a -> CharString -> CharString # genericDrop :: Integral a => a -> CharString -> CharString # genericSplitAt :: Integral a => a -> CharString -> (CharString, CharString) # genericReplicate :: Integral a => a -> Char -> CharString #
FoldableLL CharString Char # |
Instance details Defined in Data.ListLike.CharString Methods foldl :: (a -> Char -> a) -> a -> CharString -> a # foldl' :: (a -> Char -> a) -> a -> CharString -> a # foldl1 :: (Char -> Char -> Char) -> CharString -> Char # foldr :: (Char -> b -> b) -> b -> CharString -> b # foldr' :: (Char -> b -> b) -> b -> CharString -> b # foldr1 :: (Char -> Char -> Char) -> CharString -> Char #
ListLikeIO CharString Char # |
Instance details Defined in Data.ListLike.CharString Methods hGetLine :: Handle -> IO CharString # hGetContents :: Handle -> IO CharString # hGet :: Handle -> Int -> IO CharString # hGetNonBlocking :: Handle -> Int -> IO CharString # hPutStr :: Handle -> CharString -> IO () # hPutStrLn :: Handle -> CharString -> IO () # getLine :: IO CharString # getContents :: IO CharString # putStr :: CharString -> IO () # putStrLn :: CharString -> IO () # interact :: (CharString -> CharString) -> IO () # readFile :: FilePath -> IO CharString # writeFile :: FilePath -> CharString -> IO () # appendFile :: FilePath -> CharString -> IO () #
type Item CharString # |
Instance details Defined in Data.ListLike.CharString type Item CharString = Char

newtype CharStringLazy #

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 # |
Instance details Defined in Data.ListLike.CharString Methods toString :: CharStringLazy -> String # lines :: ListLike full CharStringLazy => CharStringLazy -> full # words :: ListLike full CharStringLazy => CharStringLazy -> full # unlines :: ListLike full CharStringLazy => full -> CharStringLazy # unwords :: ListLike full CharStringLazy => full -> CharStringLazy # show :: Show a => a -> CharStringLazy # fromStringLike :: StringLike s' => CharStringLazy -> s' # fromText :: Text -> CharStringLazy # fromLazyText :: Text -> CharStringLazy #
IsString CharStringLazy # |
Instance details Defined in Data.ListLike.CharString Methods fromString :: String -> CharStringLazy #
Monoid CharStringLazy # |
Instance details Defined in Data.ListLike.CharString Methods mempty :: CharStringLazy # mappend :: CharStringLazy -> CharStringLazy -> CharStringLazy # mconcat :: [CharStringLazy] -> CharStringLazy #
Semigroup CharStringLazy # |
Instance details Defined in Data.ListLike.CharString Methods (<>) :: CharStringLazy -> CharStringLazy -> CharStringLazy # sconcat :: NonEmpty CharStringLazy -> CharStringLazy # stimes :: Integral b => b -> CharStringLazy -> CharStringLazy #
IsList CharStringLazy # |
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 # fromListN :: Int -> [Item CharStringLazy] -> CharStringLazy # toList :: CharStringLazy -> [Item CharStringLazy] #
Read CharStringLazy # |
Instance details Defined in Data.ListLike.CharString Methods readsPrec :: Int -> ReadS CharStringLazy # readList :: ReadS [CharStringLazy] # readPrec :: ReadPrec CharStringLazy # readListPrec :: ReadPrec [CharStringLazy] #
Show CharStringLazy # |
Instance details Defined in Data.ListLike.CharString Methods showsPrec :: Int -> CharStringLazy -> ShowS # show :: CharStringLazy -> String # showList :: [CharStringLazy] -> ShowS #
Eq CharStringLazy # |
Instance details Defined in Data.ListLike.CharString Methods (==) :: CharStringLazy -> CharStringLazy -> Bool # (/=) :: CharStringLazy -> CharStringLazy -> Bool #
Ord CharStringLazy # |
Instance details Defined in Data.ListLike.CharString Methods compare :: CharStringLazy -> CharStringLazy -> Ordering # (<) :: CharStringLazy -> CharStringLazy -> Bool # (<=) :: CharStringLazy -> CharStringLazy -> Bool # (>) :: CharStringLazy -> CharStringLazy -> Bool # (>=) :: CharStringLazy -> CharStringLazy -> Bool # max :: CharStringLazy -> CharStringLazy -> CharStringLazy # min :: CharStringLazy -> CharStringLazy -> CharStringLazy #
ListLike CharStringLazy Char # |
Instance details Defined in Data.ListLike.CharString Methods empty :: CharStringLazy # singleton :: Char -> CharStringLazy # cons :: Char -> CharStringLazy -> CharStringLazy # snoc :: CharStringLazy -> Char -> CharStringLazy # append :: CharStringLazy -> CharStringLazy -> CharStringLazy # head :: CharStringLazy -> Char # uncons :: CharStringLazy -> Maybe (Char, CharStringLazy) # last :: CharStringLazy -> Char # tail :: CharStringLazy -> CharStringLazy # init :: CharStringLazy -> CharStringLazy # null :: CharStringLazy -> Bool # length :: CharStringLazy -> Int # map :: ListLike full' item' => (Char -> item') -> CharStringLazy -> full' # rigidMap :: (Char -> Char) -> CharStringLazy -> CharStringLazy # reverse :: CharStringLazy -> CharStringLazy # intersperse :: Char -> CharStringLazy -> CharStringLazy # concat :: ListLike full' CharStringLazy => full' -> CharStringLazy # concatMap :: ListLike full' item' => (Char -> full') -> CharStringLazy -> full' # rigidConcatMap :: (Char -> CharStringLazy) -> CharStringLazy -> CharStringLazy # any :: (Char -> Bool) -> CharStringLazy -> Bool # all :: (Char -> Bool) -> CharStringLazy -> Bool # maximum :: CharStringLazy -> Char # minimum :: CharStringLazy -> Char # replicate :: Int -> Char -> CharStringLazy # take :: Int -> CharStringLazy -> CharStringLazy # drop :: Int -> CharStringLazy -> CharStringLazy # splitAt :: Int -> CharStringLazy -> (CharStringLazy, CharStringLazy) # takeWhile :: (Char -> Bool) -> CharStringLazy -> CharStringLazy # dropWhile :: (Char -> Bool) -> CharStringLazy -> CharStringLazy # dropWhileEnd :: (Char -> Bool) -> CharStringLazy -> CharStringLazy # span :: (Char -> Bool) -> CharStringLazy -> (CharStringLazy, CharStringLazy) # break :: (Char -> Bool) -> CharStringLazy -> (CharStringLazy, CharStringLazy) # group :: (ListLike full' CharStringLazy, Eq Char) => CharStringLazy -> full' # inits :: ListLike full' CharStringLazy => CharStringLazy -> full' # tails :: ListLike full' CharStringLazy => CharStringLazy -> full' # isPrefixOf :: CharStringLazy -> CharStringLazy -> Bool # isSuffixOf :: CharStringLazy -> CharStringLazy -> Bool # isInfixOf :: CharStringLazy -> CharStringLazy -> Bool # stripPrefix :: CharStringLazy -> CharStringLazy -> Maybe CharStringLazy # stripSuffix :: CharStringLazy -> CharStringLazy -> Maybe CharStringLazy # elem :: Char -> CharStringLazy -> Bool # notElem :: Char -> CharStringLazy -> Bool # find :: (Char -> Bool) -> CharStringLazy -> Maybe Char # filter :: (Char -> Bool) -> CharStringLazy -> CharStringLazy # partition :: (Char -> Bool) -> CharStringLazy -> (CharStringLazy, CharStringLazy) # index :: CharStringLazy -> Int -> Char # elemIndex :: Char -> CharStringLazy -> Maybe Int # elemIndices :: (Eq Char, ListLike result Int) => Char -> CharStringLazy -> result # findIndex :: (Char -> Bool) -> CharStringLazy -> Maybe Int # findIndices :: ListLike result Int => (Char -> Bool) -> CharStringLazy -> result # sequence :: (Applicative m, ListLike fullinp (m Char)) => fullinp -> m CharStringLazy # mapM :: (Applicative m, ListLike full' item') => (Char -> m item') -> CharStringLazy -> m full' # rigidMapM :: Monad m => (Char -> m Char) -> CharStringLazy -> m CharStringLazy # nub :: CharStringLazy -> CharStringLazy # delete :: Char -> CharStringLazy -> CharStringLazy # deleteFirsts :: CharStringLazy -> CharStringLazy -> CharStringLazy # union :: CharStringLazy -> CharStringLazy -> CharStringLazy # intersect :: CharStringLazy -> CharStringLazy -> CharStringLazy # sort :: CharStringLazy -> CharStringLazy # insert :: Char -> CharStringLazy -> CharStringLazy # toList' :: CharStringLazy -> [Char] # fromList' :: [Char] -> CharStringLazy # fromListLike :: ListLike full' Char => CharStringLazy -> full' # nubBy :: (Char -> Char -> Bool) -> CharStringLazy -> CharStringLazy # deleteBy :: (Char -> Char -> Bool) -> Char -> CharStringLazy -> CharStringLazy # deleteFirstsBy :: (Char -> Char -> Bool) -> CharStringLazy -> CharStringLazy -> CharStringLazy # unionBy :: (Char -> Char -> Bool) -> CharStringLazy -> CharStringLazy -> CharStringLazy # intersectBy :: (Char -> Char -> Bool) -> CharStringLazy -> CharStringLazy -> CharStringLazy # groupBy :: (ListLike full' CharStringLazy, Eq Char) => (Char -> Char -> Bool) -> CharStringLazy -> full' # sortBy :: (Char -> Char -> Ordering) -> CharStringLazy -> CharStringLazy # insertBy :: (Char -> Char -> Ordering) -> Char -> CharStringLazy -> CharStringLazy # genericLength :: Num a => CharStringLazy -> a # genericTake :: Integral a => a -> CharStringLazy -> CharStringLazy # genericDrop :: Integral a => a -> CharStringLazy -> CharStringLazy # genericSplitAt :: Integral a => a -> CharStringLazy -> (CharStringLazy, CharStringLazy) # genericReplicate :: Integral a => a -> Char -> CharStringLazy #
FoldableLL CharStringLazy Char # |
Instance details Defined in Data.ListLike.CharString Methods foldl :: (a -> Char -> a) -> a -> CharStringLazy -> a # foldl' :: (a -> Char -> a) -> a -> CharStringLazy -> a # foldl1 :: (Char -> Char -> Char) -> CharStringLazy -> Char # foldr :: (Char -> b -> b) -> b -> CharStringLazy -> b # foldr' :: (Char -> b -> b) -> b -> CharStringLazy -> b # foldr1 :: (Char -> Char -> Char) -> CharStringLazy -> Char #
ListLikeIO CharStringLazy Char # |
Instance details Defined in Data.ListLike.CharString Methods hGetLine :: Handle -> IO CharStringLazy # hGetContents :: Handle -> IO CharStringLazy # hGet :: Handle -> Int -> IO CharStringLazy # hGetNonBlocking :: Handle -> Int -> IO CharStringLazy # hPutStr :: Handle -> CharStringLazy -> IO () # hPutStrLn :: Handle -> CharStringLazy -> IO () # getLine :: IO CharStringLazy # getContents :: IO CharStringLazy # putStr :: CharStringLazy -> IO () # putStrLn :: CharStringLazy -> IO () # interact :: (CharStringLazy -> CharStringLazy) -> IO () # readFile :: FilePath -> IO CharStringLazy # writeFile :: FilePath -> CharStringLazy -> IO () # appendFile :: FilePath -> CharStringLazy -> IO () #
type Item CharStringLazy # |
Instance details Defined in Data.ListLike.CharString type Item CharStringLazy = Char