string-class-0.1.6.5: String class library

Safe HaskellNone
LanguageHaskell2010

Data.String.Class

Synopsis

Documentation

class (StringCells s, StringRWIO s) => Stringy s #

String super class

Instances

class (Eq s, Monoid s, IsString s, Typeable s, StringCell (StringCellChar s), StringCell (StringCellAltChar s), ConvGenString s, ConvString s, ConvStrictByteString s, ConvLazyByteString s, ConvText s, ConvLazyText s) => StringCells s where #

Minimal complete definition: StringCellChar; StringCellAltChar; toStringCells; fromStringCells; toMainChar; toAltChar; cons; snoc; either all of head, tail, last, and init, or all of uncons and unsnoc; take, take64 or genericTake; drop, drop64, or genericDrop; and length, length64, or genericLength

Minimal complete definition

toStringCells, fromStringCells, cons, snoc, toMainChar, toAltChar

Associated Types

type StringCellChar s #

type StringCellAltChar s #

Methods

toStringCells :: StringCells s2 => s -> s2 #

fromStringCells :: StringCells s2 => s2 -> s #

cons :: StringCellChar s -> s -> s infixr 9 #

uncons :: s -> (StringCellChar s, s) infixr 9 #

snoc :: s -> StringCellChar s -> s #

unsnoc :: s -> (s, StringCellChar s) #

altCons :: StringCellAltChar s -> s -> s infixr 9 #

altUncons :: s -> (StringCellAltChar s, s) infixr 9 #

altSnoc :: s -> StringCellAltChar s -> s #

altUnsnoc :: s -> (s, StringCellAltChar s) #

toMainChar :: StringCell c => c -> Tagged s (StringCellChar s) #

toAltChar :: StringCell c => c -> Tagged s (StringCellAltChar s) #

append :: s -> s -> s infixr 9 #

Append two strings

concat :: [s] -> s #

empty :: s #

null :: s -> Bool #

head :: s -> StringCellChar s #

tail :: s -> s #

last :: s -> StringCellChar s #

init :: s -> s #

altHead :: s -> StringCellAltChar s #

altLast :: s -> StringCellAltChar s #

unfoldr :: (a -> Maybe (StringCellChar s, a)) -> a -> s #

Construction of a string; implementations should behave safely with incorrect lengths

The default implementation of unfoldr is independent from that of altUnfoldr, as well as unfoldrN as and altUnfoldrN.

altUnfoldr :: (a -> Maybe (StringCellAltChar s, a)) -> a -> s #

unfoldrN :: Int -> (a -> Maybe (StringCellChar s, a)) -> a -> s #

altUnfoldrN :: Int -> (a -> Maybe (StringCellAltChar s, a)) -> a -> s #

unfoldrN64 :: Int64 -> (a -> Maybe (StringCellChar s, a)) -> a -> s #

altUnfoldrN64 :: Int64 -> (a -> Maybe (StringCellAltChar s, a)) -> a -> s #

index :: s -> Int -> StringCellChar s #

Get the character at the given position

Just like drop, drop64, and the variants of those functions, the default definitions of these three variants are independent of each other, and are defined in terms of head and tail, which can be inefficient.

index64 :: s -> Int64 -> StringCellChar s #

genericIndex :: Integral i => s -> i -> StringCellChar s #

Index a string at any location

Just like the other generic functions of this module, this function can be significantly slower than index, since the function must be able to support arbitrarily large indices. Consider using index or index64, even if you need to coerce the index to an Int.

take :: Int -> s -> s #

take64 :: Int64 -> s -> s #

genericTake :: Integral i => i -> s -> s #

drop :: Int -> s -> s #

drop64 :: Int64 -> s -> s #

genericDrop :: Integral i => i -> s -> s #

length :: s -> Int #

length64 :: s -> Int64 #

genericLength :: Integral i => s -> i #

safeUncons :: s -> Maybe (StringCellChar s, s) #

safeUnsnoc :: s -> Maybe (s, StringCellChar s) #

safeAltUncons :: s -> Maybe (StringCellAltChar s, s) #

safeAltUnsnoc :: s -> Maybe (s, StringCellAltChar s) #

safeHead :: s -> Maybe (StringCellChar s) #

safeTail :: s -> Maybe s #

safeLast :: s -> Maybe (StringCellChar s) #

safeInit :: s -> Maybe s #

safeAltHead :: s -> Maybe (StringCellAltChar s) #

safeAltLast :: s -> Maybe (StringCellAltChar s) #

safeIndex :: s -> Int -> Maybe (StringCellChar s) #

safeIndex64 :: s -> Int64 -> Maybe (StringCellChar s) #

safeGenericIndex :: Integral i => s -> i -> Maybe (StringCellChar s) #

safeTake :: Int -> s -> Maybe s #

safeTake64 :: Int64 -> s -> Maybe s #

safeGenericTake :: Integral i => i -> s -> Maybe s #

safeDrop :: Int -> s -> Maybe s #

safeDrop64 :: Int64 -> s -> Maybe s #

safeGenericDrop :: Integral i => i -> s -> Maybe s #

safeUncons2 :: s -> Maybe (StringCellChar s, StringCellChar s, s) #

safeUncons3 :: s -> Maybe (StringCellChar s, StringCellChar s, StringCellChar s, s) #

safeUncons4 :: s -> Maybe (StringCellChar s, StringCellChar s, StringCellChar s, StringCellChar s, s) #

cons2 :: StringCellChar s -> StringCellChar s -> s -> s infixr 9 #

cons3 :: StringCellChar s -> StringCellChar s -> StringCellChar s -> s -> s infixr 9 #

cons4 :: StringCellChar s -> StringCellChar s -> StringCellChar s -> StringCellChar s -> s -> s infixr 9 #

uncons2 :: s -> (StringCellChar s, StringCellChar s, s) infixr 9 #

uncons3 :: s -> (StringCellChar s, StringCellChar s, StringCellChar s, s) infixr 9 #

uncons4 :: s -> (StringCellChar s, StringCellChar s, StringCellChar s, StringCellChar s, s) infixr 9 #

Instances

StringCells String # 

Associated Types

type StringCellChar String :: * #

type StringCellAltChar String :: * #

Methods

toStringCells :: StringCells s2 => String -> s2 #

fromStringCells :: StringCells s2 => s2 -> String #

cons :: StringCellChar String -> String -> String #

uncons :: String -> (StringCellChar String, String) #

snoc :: String -> StringCellChar String -> String #

unsnoc :: String -> (String, StringCellChar String) #

altCons :: StringCellAltChar String -> String -> String #

altUncons :: String -> (StringCellAltChar String, String) #

altSnoc :: String -> StringCellAltChar String -> String #

altUnsnoc :: String -> (String, StringCellAltChar String) #

toMainChar :: StringCell c => c -> Tagged * String (StringCellChar String) #

toAltChar :: StringCell c => c -> Tagged * String (StringCellAltChar String) #

append :: String -> String -> String #

concat :: [String] -> String #

empty :: String #

null :: String -> Bool #

head :: String -> StringCellChar String #

tail :: String -> String #

last :: String -> StringCellChar String #

init :: String -> String #

altHead :: String -> StringCellAltChar String #

altLast :: String -> StringCellAltChar String #

unfoldr :: (a -> Maybe (StringCellChar String, a)) -> a -> String #

altUnfoldr :: (a -> Maybe (StringCellAltChar String, a)) -> a -> String #

unfoldrN :: Int -> (a -> Maybe (StringCellChar String, a)) -> a -> String #

altUnfoldrN :: Int -> (a -> Maybe (StringCellAltChar String, a)) -> a -> String #

unfoldrN64 :: Int64 -> (a -> Maybe (StringCellChar String, a)) -> a -> String #

altUnfoldrN64 :: Int64 -> (a -> Maybe (StringCellAltChar String, a)) -> a -> String #

index :: String -> Int -> StringCellChar String #

index64 :: String -> Int64 -> StringCellChar String #

genericIndex :: Integral i => String -> i -> StringCellChar String #

take :: Int -> String -> String #

take64 :: Int64 -> String -> String #

genericTake :: Integral i => i -> String -> String #

drop :: Int -> String -> String #

drop64 :: Int64 -> String -> String #

genericDrop :: Integral i => i -> String -> String #

length :: String -> Int #

length64 :: String -> Int64 #

genericLength :: Integral i => String -> i #

safeUncons :: String -> Maybe (StringCellChar String, String) #

safeUnsnoc :: String -> Maybe (String, StringCellChar String) #

safeAltUncons :: String -> Maybe (StringCellAltChar String, String) #

safeAltUnsnoc :: String -> Maybe (String, StringCellAltChar String) #

safeHead :: String -> Maybe (StringCellChar String) #

safeTail :: String -> Maybe String #

safeLast :: String -> Maybe (StringCellChar String) #

safeInit :: String -> Maybe String #

safeAltHead :: String -> Maybe (StringCellAltChar String) #

safeAltLast :: String -> Maybe (StringCellAltChar String) #

safeIndex :: String -> Int -> Maybe (StringCellChar String) #

safeIndex64 :: String -> Int64 -> Maybe (StringCellChar String) #

safeGenericIndex :: Integral i => String -> i -> Maybe (StringCellChar String) #

safeTake :: Int -> String -> Maybe String #

safeTake64 :: Int64 -> String -> Maybe String #

safeGenericTake :: Integral i => i -> String -> Maybe String #

safeDrop :: Int -> String -> Maybe String #

safeDrop64 :: Int64 -> String -> Maybe String #

safeGenericDrop :: Integral i => i -> String -> Maybe String #

safeUncons2 :: String -> Maybe (StringCellChar String, StringCellChar String, String) #

safeUncons3 :: String -> Maybe (StringCellChar String, StringCellChar String, StringCellChar String, String) #

safeUncons4 :: String -> Maybe (StringCellChar String, StringCellChar String, StringCellChar String, StringCellChar String, String) #

cons2 :: StringCellChar String -> StringCellChar String -> String -> String #

cons3 :: StringCellChar String -> StringCellChar String -> StringCellChar String -> String -> String #

cons4 :: StringCellChar String -> StringCellChar String -> StringCellChar String -> StringCellChar String -> String -> String #

uncons2 :: String -> (StringCellChar String, StringCellChar String, String) #

uncons3 :: String -> (StringCellChar String, StringCellChar String, StringCellChar String, String) #

uncons4 :: String -> (StringCellChar String, StringCellChar String, StringCellChar String, StringCellChar String, String) #

StringCells ByteString # 

Associated Types

type StringCellChar ByteString :: * #

type StringCellAltChar ByteString :: * #

Methods

toStringCells :: StringCells s2 => ByteString -> s2 #

fromStringCells :: StringCells s2 => s2 -> ByteString #

cons :: StringCellChar ByteString -> ByteString -> ByteString #

uncons :: ByteString -> (StringCellChar ByteString, ByteString) #

snoc :: ByteString -> StringCellChar ByteString -> ByteString #

unsnoc :: ByteString -> (ByteString, StringCellChar ByteString) #

altCons :: StringCellAltChar ByteString -> ByteString -> ByteString #

altUncons :: ByteString -> (StringCellAltChar ByteString, ByteString) #

altSnoc :: ByteString -> StringCellAltChar ByteString -> ByteString #

altUnsnoc :: ByteString -> (ByteString, StringCellAltChar ByteString) #

toMainChar :: StringCell c => c -> Tagged * ByteString (StringCellChar ByteString) #

toAltChar :: StringCell c => c -> Tagged * ByteString (StringCellAltChar ByteString) #

append :: ByteString -> ByteString -> ByteString #

concat :: [ByteString] -> ByteString #

empty :: ByteString #

null :: ByteString -> Bool #

head :: ByteString -> StringCellChar ByteString #

tail :: ByteString -> ByteString #

last :: ByteString -> StringCellChar ByteString #

init :: ByteString -> ByteString #

altHead :: ByteString -> StringCellAltChar ByteString #

altLast :: ByteString -> StringCellAltChar ByteString #

unfoldr :: (a -> Maybe (StringCellChar ByteString, a)) -> a -> ByteString #

altUnfoldr :: (a -> Maybe (StringCellAltChar ByteString, a)) -> a -> ByteString #

unfoldrN :: Int -> (a -> Maybe (StringCellChar ByteString, a)) -> a -> ByteString #

altUnfoldrN :: Int -> (a -> Maybe (StringCellAltChar ByteString, a)) -> a -> ByteString #

unfoldrN64 :: Int64 -> (a -> Maybe (StringCellChar ByteString, a)) -> a -> ByteString #

altUnfoldrN64 :: Int64 -> (a -> Maybe (StringCellAltChar ByteString, a)) -> a -> ByteString #

index :: ByteString -> Int -> StringCellChar ByteString #

index64 :: ByteString -> Int64 -> StringCellChar ByteString #

genericIndex :: Integral i => ByteString -> i -> StringCellChar ByteString #

take :: Int -> ByteString -> ByteString #

take64 :: Int64 -> ByteString -> ByteString #

genericTake :: Integral i => i -> ByteString -> ByteString #

drop :: Int -> ByteString -> ByteString #

drop64 :: Int64 -> ByteString -> ByteString #

genericDrop :: Integral i => i -> ByteString -> ByteString #

length :: ByteString -> Int #

length64 :: ByteString -> Int64 #

genericLength :: Integral i => ByteString -> i #

safeUncons :: ByteString -> Maybe (StringCellChar ByteString, ByteString) #

safeUnsnoc :: ByteString -> Maybe (ByteString, StringCellChar ByteString) #

safeAltUncons :: ByteString -> Maybe (StringCellAltChar ByteString, ByteString) #

safeAltUnsnoc :: ByteString -> Maybe (ByteString, StringCellAltChar ByteString) #

safeHead :: ByteString -> Maybe (StringCellChar ByteString) #

safeTail :: ByteString -> Maybe ByteString #

safeLast :: ByteString -> Maybe (StringCellChar ByteString) #

safeInit :: ByteString -> Maybe ByteString #

safeAltHead :: ByteString -> Maybe (StringCellAltChar ByteString) #

safeAltLast :: ByteString -> Maybe (StringCellAltChar ByteString) #

safeIndex :: ByteString -> Int -> Maybe (StringCellChar ByteString) #

safeIndex64 :: ByteString -> Int64 -> Maybe (StringCellChar ByteString) #

safeGenericIndex :: Integral i => ByteString -> i -> Maybe (StringCellChar ByteString) #

safeTake :: Int -> ByteString -> Maybe ByteString #

safeTake64 :: Int64 -> ByteString -> Maybe ByteString #

safeGenericTake :: Integral i => i -> ByteString -> Maybe ByteString #

safeDrop :: Int -> ByteString -> Maybe ByteString #

safeDrop64 :: Int64 -> ByteString -> Maybe ByteString #

safeGenericDrop :: Integral i => i -> ByteString -> Maybe ByteString #

safeUncons2 :: ByteString -> Maybe (StringCellChar ByteString, StringCellChar ByteString, ByteString) #

safeUncons3 :: ByteString -> Maybe (StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, ByteString) #

safeUncons4 :: ByteString -> Maybe (StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, ByteString) #

cons2 :: StringCellChar ByteString -> StringCellChar ByteString -> ByteString -> ByteString #

cons3 :: StringCellChar ByteString -> StringCellChar ByteString -> StringCellChar ByteString -> ByteString -> ByteString #

cons4 :: StringCellChar ByteString -> StringCellChar ByteString -> StringCellChar ByteString -> StringCellChar ByteString -> ByteString -> ByteString #

uncons2 :: ByteString -> (StringCellChar ByteString, StringCellChar ByteString, ByteString) #

uncons3 :: ByteString -> (StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, ByteString) #

uncons4 :: ByteString -> (StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, ByteString) #

StringCells ByteString # 

Associated Types

type StringCellChar ByteString :: * #

type StringCellAltChar ByteString :: * #

Methods

toStringCells :: StringCells s2 => ByteString -> s2 #

fromStringCells :: StringCells s2 => s2 -> ByteString #

cons :: StringCellChar ByteString -> ByteString -> ByteString #

uncons :: ByteString -> (StringCellChar ByteString, ByteString) #

snoc :: ByteString -> StringCellChar ByteString -> ByteString #

unsnoc :: ByteString -> (ByteString, StringCellChar ByteString) #

altCons :: StringCellAltChar ByteString -> ByteString -> ByteString #

altUncons :: ByteString -> (StringCellAltChar ByteString, ByteString) #

altSnoc :: ByteString -> StringCellAltChar ByteString -> ByteString #

altUnsnoc :: ByteString -> (ByteString, StringCellAltChar ByteString) #

toMainChar :: StringCell c => c -> Tagged * ByteString (StringCellChar ByteString) #

toAltChar :: StringCell c => c -> Tagged * ByteString (StringCellAltChar ByteString) #

append :: ByteString -> ByteString -> ByteString #

concat :: [ByteString] -> ByteString #

empty :: ByteString #

null :: ByteString -> Bool #

head :: ByteString -> StringCellChar ByteString #

tail :: ByteString -> ByteString #

last :: ByteString -> StringCellChar ByteString #

init :: ByteString -> ByteString #

altHead :: ByteString -> StringCellAltChar ByteString #

altLast :: ByteString -> StringCellAltChar ByteString #

unfoldr :: (a -> Maybe (StringCellChar ByteString, a)) -> a -> ByteString #

altUnfoldr :: (a -> Maybe (StringCellAltChar ByteString, a)) -> a -> ByteString #

unfoldrN :: Int -> (a -> Maybe (StringCellChar ByteString, a)) -> a -> ByteString #

altUnfoldrN :: Int -> (a -> Maybe (StringCellAltChar ByteString, a)) -> a -> ByteString #

unfoldrN64 :: Int64 -> (a -> Maybe (StringCellChar ByteString, a)) -> a -> ByteString #

altUnfoldrN64 :: Int64 -> (a -> Maybe (StringCellAltChar ByteString, a)) -> a -> ByteString #

index :: ByteString -> Int -> StringCellChar ByteString #

index64 :: ByteString -> Int64 -> StringCellChar ByteString #

genericIndex :: Integral i => ByteString -> i -> StringCellChar ByteString #

take :: Int -> ByteString -> ByteString #

take64 :: Int64 -> ByteString -> ByteString #

genericTake :: Integral i => i -> ByteString -> ByteString #

drop :: Int -> ByteString -> ByteString #

drop64 :: Int64 -> ByteString -> ByteString #

genericDrop :: Integral i => i -> ByteString -> ByteString #

length :: ByteString -> Int #

length64 :: ByteString -> Int64 #

genericLength :: Integral i => ByteString -> i #

safeUncons :: ByteString -> Maybe (StringCellChar ByteString, ByteString) #

safeUnsnoc :: ByteString -> Maybe (ByteString, StringCellChar ByteString) #

safeAltUncons :: ByteString -> Maybe (StringCellAltChar ByteString, ByteString) #

safeAltUnsnoc :: ByteString -> Maybe (ByteString, StringCellAltChar ByteString) #

safeHead :: ByteString -> Maybe (StringCellChar ByteString) #

safeTail :: ByteString -> Maybe ByteString #

safeLast :: ByteString -> Maybe (StringCellChar ByteString) #

safeInit :: ByteString -> Maybe ByteString #

safeAltHead :: ByteString -> Maybe (StringCellAltChar ByteString) #

safeAltLast :: ByteString -> Maybe (StringCellAltChar ByteString) #

safeIndex :: ByteString -> Int -> Maybe (StringCellChar ByteString) #

safeIndex64 :: ByteString -> Int64 -> Maybe (StringCellChar ByteString) #

safeGenericIndex :: Integral i => ByteString -> i -> Maybe (StringCellChar ByteString) #

safeTake :: Int -> ByteString -> Maybe ByteString #

safeTake64 :: Int64 -> ByteString -> Maybe ByteString #

safeGenericTake :: Integral i => i -> ByteString -> Maybe ByteString #

safeDrop :: Int -> ByteString -> Maybe ByteString #

safeDrop64 :: Int64 -> ByteString -> Maybe ByteString #

safeGenericDrop :: Integral i => i -> ByteString -> Maybe ByteString #

safeUncons2 :: ByteString -> Maybe (StringCellChar ByteString, StringCellChar ByteString, ByteString) #

safeUncons3 :: ByteString -> Maybe (StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, ByteString) #

safeUncons4 :: ByteString -> Maybe (StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, ByteString) #

cons2 :: StringCellChar ByteString -> StringCellChar ByteString -> ByteString -> ByteString #

cons3 :: StringCellChar ByteString -> StringCellChar ByteString -> StringCellChar ByteString -> ByteString -> ByteString #

cons4 :: StringCellChar ByteString -> StringCellChar ByteString -> StringCellChar ByteString -> StringCellChar ByteString -> ByteString -> ByteString #

uncons2 :: ByteString -> (StringCellChar ByteString, StringCellChar ByteString, ByteString) #

uncons3 :: ByteString -> (StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, ByteString) #

uncons4 :: ByteString -> (StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, StringCellChar ByteString, ByteString) #

StringCells Text # 

Associated Types

type StringCellChar Text :: * #

type StringCellAltChar Text :: * #

Methods

toStringCells :: StringCells s2 => Text -> s2 #

fromStringCells :: StringCells s2 => s2 -> Text #

cons :: StringCellChar Text -> Text -> Text #

uncons :: Text -> (StringCellChar Text, Text) #

snoc :: Text -> StringCellChar Text -> Text #

unsnoc :: Text -> (Text, StringCellChar Text) #

altCons :: StringCellAltChar Text -> Text -> Text #

altUncons :: Text -> (StringCellAltChar Text, Text) #

altSnoc :: Text -> StringCellAltChar Text -> Text #

altUnsnoc :: Text -> (Text, StringCellAltChar Text) #

toMainChar :: StringCell c => c -> Tagged * Text (StringCellChar Text) #

toAltChar :: StringCell c => c -> Tagged * Text (StringCellAltChar Text) #

append :: Text -> Text -> Text #

concat :: [Text] -> Text #

empty :: Text #

null :: Text -> Bool #

head :: Text -> StringCellChar Text #

tail :: Text -> Text #

last :: Text -> StringCellChar Text #

init :: Text -> Text #

altHead :: Text -> StringCellAltChar Text #

altLast :: Text -> StringCellAltChar Text #

unfoldr :: (a -> Maybe (StringCellChar Text, a)) -> a -> Text #

altUnfoldr :: (a -> Maybe (StringCellAltChar Text, a)) -> a -> Text #

unfoldrN :: Int -> (a -> Maybe (StringCellChar Text, a)) -> a -> Text #

altUnfoldrN :: Int -> (a -> Maybe (StringCellAltChar Text, a)) -> a -> Text #

unfoldrN64 :: Int64 -> (a -> Maybe (StringCellChar Text, a)) -> a -> Text #

altUnfoldrN64 :: Int64 -> (a -> Maybe (StringCellAltChar Text, a)) -> a -> Text #

index :: Text -> Int -> StringCellChar Text #

index64 :: Text -> Int64 -> StringCellChar Text #

genericIndex :: Integral i => Text -> i -> StringCellChar Text #

take :: Int -> Text -> Text #

take64 :: Int64 -> Text -> Text #

genericTake :: Integral i => i -> Text -> Text #

drop :: Int -> Text -> Text #

drop64 :: Int64 -> Text -> Text #

genericDrop :: Integral i => i -> Text -> Text #

length :: Text -> Int #

length64 :: Text -> Int64 #

genericLength :: Integral i => Text -> i #

safeUncons :: Text -> Maybe (StringCellChar Text, Text) #

safeUnsnoc :: Text -> Maybe (Text, StringCellChar Text) #

safeAltUncons :: Text -> Maybe (StringCellAltChar Text, Text) #

safeAltUnsnoc :: Text -> Maybe (Text, StringCellAltChar Text) #

safeHead :: Text -> Maybe (StringCellChar Text) #

safeTail :: Text -> Maybe Text #

safeLast :: Text -> Maybe (StringCellChar Text) #

safeInit :: Text -> Maybe Text #

safeAltHead :: Text -> Maybe (StringCellAltChar Text) #

safeAltLast :: Text -> Maybe (StringCellAltChar Text) #

safeIndex :: Text -> Int -> Maybe (StringCellChar Text) #

safeIndex64 :: Text -> Int64 -> Maybe (StringCellChar Text) #

safeGenericIndex :: Integral i => Text -> i -> Maybe (StringCellChar Text) #

safeTake :: Int -> Text -> Maybe Text #

safeTake64 :: Int64 -> Text -> Maybe Text #

safeGenericTake :: Integral i => i -> Text -> Maybe Text #

safeDrop :: Int -> Text -> Maybe Text #

safeDrop64 :: Int64 -> Text -> Maybe Text #

safeGenericDrop :: Integral i => i -> Text -> Maybe Text #

safeUncons2 :: Text -> Maybe (StringCellChar Text, StringCellChar Text, Text) #

safeUncons3 :: Text -> Maybe (StringCellChar Text, StringCellChar Text, StringCellChar Text, Text) #

safeUncons4 :: Text -> Maybe (StringCellChar Text, StringCellChar Text, StringCellChar Text, StringCellChar Text, Text) #

cons2 :: StringCellChar Text -> StringCellChar Text -> Text -> Text #

cons3 :: StringCellChar Text -> StringCellChar Text -> StringCellChar Text -> Text -> Text #

cons4 :: StringCellChar Text -> StringCellChar Text -> StringCellChar Text -> StringCellChar Text -> Text -> Text #

uncons2 :: Text -> (StringCellChar Text, StringCellChar Text, Text) #

uncons3 :: Text -> (StringCellChar Text, StringCellChar Text, StringCellChar Text, Text) #

uncons4 :: Text -> (StringCellChar Text, StringCellChar Text, StringCellChar Text, StringCellChar Text, Text) #

StringCells Text # 

Associated Types

type StringCellChar Text :: * #

type StringCellAltChar Text :: * #

Methods

toStringCells :: StringCells s2 => Text -> s2 #

fromStringCells :: StringCells s2 => s2 -> Text #

cons :: StringCellChar Text -> Text -> Text #

uncons :: Text -> (StringCellChar Text, Text) #

snoc :: Text -> StringCellChar Text -> Text #

unsnoc :: Text -> (Text, StringCellChar Text) #

altCons :: StringCellAltChar Text -> Text -> Text #

altUncons :: Text -> (StringCellAltChar Text, Text) #

altSnoc :: Text -> StringCellAltChar Text -> Text #

altUnsnoc :: Text -> (Text, StringCellAltChar Text) #

toMainChar :: StringCell c => c -> Tagged * Text (StringCellChar Text) #

toAltChar :: StringCell c => c -> Tagged * Text (StringCellAltChar Text) #

append :: Text -> Text -> Text #

concat :: [Text] -> Text #

empty :: Text #

null :: Text -> Bool #

head :: Text -> StringCellChar Text #

tail :: Text -> Text #

last :: Text -> StringCellChar Text #

init :: Text -> Text #

altHead :: Text -> StringCellAltChar Text #

altLast :: Text -> StringCellAltChar Text #

unfoldr :: (a -> Maybe (StringCellChar Text, a)) -> a -> Text #

altUnfoldr :: (a -> Maybe (StringCellAltChar Text, a)) -> a -> Text #

unfoldrN :: Int -> (a -> Maybe (StringCellChar Text, a)) -> a -> Text #

altUnfoldrN :: Int -> (a -> Maybe (StringCellAltChar Text, a)) -> a -> Text #

unfoldrN64 :: Int64 -> (a -> Maybe (StringCellChar Text, a)) -> a -> Text #

altUnfoldrN64 :: Int64 -> (a -> Maybe (StringCellAltChar Text, a)) -> a -> Text #

index :: Text -> Int -> StringCellChar Text #

index64 :: Text -> Int64 -> StringCellChar Text #

genericIndex :: Integral i => Text -> i -> StringCellChar Text #

take :: Int -> Text -> Text #

take64 :: Int64 -> Text -> Text #

genericTake :: Integral i => i -> Text -> Text #

drop :: Int -> Text -> Text #

drop64 :: Int64 -> Text -> Text #

genericDrop :: Integral i => i -> Text -> Text #

length :: Text -> Int #

length64 :: Text -> Int64 #

genericLength :: Integral i => Text -> i #

safeUncons :: Text -> Maybe (StringCellChar Text, Text) #

safeUnsnoc :: Text -> Maybe (Text, StringCellChar Text) #

safeAltUncons :: Text -> Maybe (StringCellAltChar Text, Text) #

safeAltUnsnoc :: Text -> Maybe (Text, StringCellAltChar Text) #

safeHead :: Text -> Maybe (StringCellChar Text) #

safeTail :: Text -> Maybe Text #

safeLast :: Text -> Maybe (StringCellChar Text) #

safeInit :: Text -> Maybe Text #

safeAltHead :: Text -> Maybe (StringCellAltChar Text) #

safeAltLast :: Text -> Maybe (StringCellAltChar Text) #

safeIndex :: Text -> Int -> Maybe (StringCellChar Text) #

safeIndex64 :: Text -> Int64 -> Maybe (StringCellChar Text) #

safeGenericIndex :: Integral i => Text -> i -> Maybe (StringCellChar Text) #

safeTake :: Int -> Text -> Maybe Text #

safeTake64 :: Int64 -> Text -> Maybe Text #

safeGenericTake :: Integral i => i -> Text -> Maybe Text #

safeDrop :: Int -> Text -> Maybe Text #

safeDrop64 :: Int64 -> Text -> Maybe Text #

safeGenericDrop :: Integral i => i -> Text -> Maybe Text #

safeUncons2 :: Text -> Maybe (StringCellChar Text, StringCellChar Text, Text) #

safeUncons3 :: Text -> Maybe (StringCellChar Text, StringCellChar Text, StringCellChar Text, Text) #

safeUncons4 :: Text -> Maybe (StringCellChar Text, StringCellChar Text, StringCellChar Text, StringCellChar Text, Text) #

cons2 :: StringCellChar Text -> StringCellChar Text -> Text -> Text #

cons3 :: StringCellChar Text -> StringCellChar Text -> StringCellChar Text -> Text -> Text #

cons4 :: StringCellChar Text -> StringCellChar Text -> StringCellChar Text -> StringCellChar Text -> Text -> Text #

uncons2 :: Text -> (StringCellChar Text, StringCellChar Text, Text) #

uncons3 :: Text -> (StringCellChar Text, StringCellChar Text, StringCellChar Text, Text) #

uncons4 :: Text -> (StringCellChar Text, StringCellChar Text, StringCellChar Text, StringCellChar Text, Text) #

StringCells GenString # 

Associated Types

type StringCellChar GenString :: * #

type StringCellAltChar GenString :: * #

Methods

toStringCells :: StringCells s2 => GenString -> s2 #

fromStringCells :: StringCells s2 => s2 -> GenString #

cons :: StringCellChar GenString -> GenString -> GenString #

uncons :: GenString -> (StringCellChar GenString, GenString) #

snoc :: GenString -> StringCellChar GenString -> GenString #

unsnoc :: GenString -> (GenString, StringCellChar GenString) #

altCons :: StringCellAltChar GenString -> GenString -> GenString #

altUncons :: GenString -> (StringCellAltChar GenString, GenString) #

altSnoc :: GenString -> StringCellAltChar GenString -> GenString #

altUnsnoc :: GenString -> (GenString, StringCellAltChar GenString) #

toMainChar :: StringCell c => c -> Tagged * GenString (StringCellChar GenString) #

toAltChar :: StringCell c => c -> Tagged * GenString (StringCellAltChar GenString) #

append :: GenString -> GenString -> GenString #

concat :: [GenString] -> GenString #

empty :: GenString #

null :: GenString -> Bool #

head :: GenString -> StringCellChar GenString #

tail :: GenString -> GenString #

last :: GenString -> StringCellChar GenString #

init :: GenString -> GenString #

altHead :: GenString -> StringCellAltChar GenString #

altLast :: GenString -> StringCellAltChar GenString #

unfoldr :: (a -> Maybe (StringCellChar GenString, a)) -> a -> GenString #

altUnfoldr :: (a -> Maybe (StringCellAltChar GenString, a)) -> a -> GenString #

unfoldrN :: Int -> (a -> Maybe (StringCellChar GenString, a)) -> a -> GenString #

altUnfoldrN :: Int -> (a -> Maybe (StringCellAltChar GenString, a)) -> a -> GenString #

unfoldrN64 :: Int64 -> (a -> Maybe (StringCellChar GenString, a)) -> a -> GenString #

altUnfoldrN64 :: Int64 -> (a -> Maybe (StringCellAltChar GenString, a)) -> a -> GenString #

index :: GenString -> Int -> StringCellChar GenString #

index64 :: GenString -> Int64 -> StringCellChar GenString #

genericIndex :: Integral i => GenString -> i -> StringCellChar GenString #

take :: Int -> GenString -> GenString #

take64 :: Int64 -> GenString -> GenString #

genericTake :: Integral i => i -> GenString -> GenString #

drop :: Int -> GenString -> GenString #

drop64 :: Int64 -> GenString -> GenString #

genericDrop :: Integral i => i -> GenString -> GenString #

length :: GenString -> Int #

length64 :: GenString -> Int64 #

genericLength :: Integral i => GenString -> i #

safeUncons :: GenString -> Maybe (StringCellChar GenString, GenString) #

safeUnsnoc :: GenString -> Maybe (GenString, StringCellChar GenString) #

safeAltUncons :: GenString -> Maybe (StringCellAltChar GenString, GenString) #

safeAltUnsnoc :: GenString -> Maybe (GenString, StringCellAltChar GenString) #

safeHead :: GenString -> Maybe (StringCellChar GenString) #

safeTail :: GenString -> Maybe GenString #

safeLast :: GenString -> Maybe (StringCellChar GenString) #

safeInit :: GenString -> Maybe GenString #

safeAltHead :: GenString -> Maybe (StringCellAltChar GenString) #

safeAltLast :: GenString -> Maybe (StringCellAltChar GenString) #

safeIndex :: GenString -> Int -> Maybe (StringCellChar GenString) #

safeIndex64 :: GenString -> Int64 -> Maybe (StringCellChar GenString) #

safeGenericIndex :: Integral i => GenString -> i -> Maybe (StringCellChar GenString) #

safeTake :: Int -> GenString -> Maybe GenString #

safeTake64 :: Int64 -> GenString -> Maybe GenString #

safeGenericTake :: Integral i => i -> GenString -> Maybe GenString #

safeDrop :: Int -> GenString -> Maybe GenString #

safeDrop64 :: Int64 -> GenString -> Maybe GenString #

safeGenericDrop :: Integral i => i -> GenString -> Maybe GenString #

safeUncons2 :: GenString -> Maybe (StringCellChar GenString, StringCellChar GenString, GenString) #

safeUncons3 :: GenString -> Maybe (StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, GenString) #

safeUncons4 :: GenString -> Maybe (StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, GenString) #

cons2 :: StringCellChar GenString -> StringCellChar GenString -> GenString -> GenString #

cons3 :: StringCellChar GenString -> StringCellChar GenString -> StringCellChar GenString -> GenString -> GenString #

cons4 :: StringCellChar GenString -> StringCellChar GenString -> StringCellChar GenString -> StringCellChar GenString -> GenString -> GenString #

uncons2 :: GenString -> (StringCellChar GenString, StringCellChar GenString, GenString) #

uncons3 :: GenString -> (StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, GenString) #

uncons4 :: GenString -> (StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, GenString) #

class StringCell c where #

Methods

toChar :: c -> Char #

toWord8 :: c -> Word8 #

toWord16 :: c -> Word16 #

toWord32 :: c -> Word32 #

toWord64 :: c -> Word64 #

fromChar :: Char -> c #

fromWord8 :: Word8 -> c #

fromWord16 :: Word16 -> c #

fromWord32 :: Word32 -> c #

fromWord64 :: Word64 -> c #

Instances

StringCell Char # 
StringCell Word8 # 
StringCell Word16 # 
StringCell Word32 # 
StringCell Word64 # 

class StringRWIO s where #

Minimal complete definition: hGetContents, hGetLine, hPutStr, and hPutStrLn

Minimal complete definition

hGetContents, hGetLine, hPutStr, hPutStrLn

Methods

hGetContents :: Handle -> IO s #

Read n bytes *or* characters, depending on the implementation into a ByteString, directly from the specified Handle

Whether or not this function is lazy depends on the instance; laziness is preferred.

hGetLine :: Handle -> IO s #

Read a single line from a handle

hPutStr :: Handle -> s -> IO () #

Write a string to a handle

hPutStrLn :: Handle -> s -> IO () #

Write a string to a handle, followed by a newline

N.B.: implementations might not define this atomically. If the state of being atomic is necessary, one possible solution is to convert a string to an efficient type for which hPutStrLn is atomic.

interact :: (s -> s) -> IO () #

Take a function of type Text -> Text as its argument

The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.

getContents :: IO s #

Read all user input on stdin as a single string

getLine :: IO s #

Read a single line of user input from stdin

putStr :: s -> IO () #

Write a string to stdout

putStrLn :: s -> IO () #

Write a string to stdout, followed by a newline

readFile :: FilePath -> IO s #

Read a file and returns the contents of the file as a string

Depending on the instance, this function might expect the file to be non-binary. The default definition uses openFile to open the file.

writeFile :: FilePath -> s -> IO () #

Write a string to a file

The file is truncated to zero length before writing begins. The default definition uses withFile to open the file.

appendFile :: FilePath -> s -> IO () #

Write a string to the end of a file

The default definition uses withFile to open the file.

Instances

StringRWIO String #

See 'System.IO for documentation of behaviour.

StringRWIO ByteString #

See Lazy for documentation of behaviour.

hGetLine and getLine are defined in terms of toStringCells and the equivalent methods of ByteString. hPutStrLn is defined non-atomically: it is defined as an action that puts the string and then separately puts a newline character string.

StringRWIO ByteString #

See ByteString for documentation of behaviour.

StringRWIO Text #

See IO for documentation of behaviour.

StringRWIO Text #

See IO for documentation of behaviour.

StringRWIO GenString #

This is minimally defined with GenStringDefault.

class ConvText s where #

Minimal complete definition

toText, fromText

Methods

toText :: s -> Text #

fromText :: Text -> s #

data GenString #

Polymorphic container of a string

When operations take place on multiple GenStrings, they are first converted to the type GenStringDefault, which are lazy bytestrings, whenever absolutely necessary (which includes testing for equality, appending strings, concatenating lists of strings, empty strings with empty, and unfolding), making them the most efficient type for this polymorphic container.

Constructors

Stringy s => GenString 

Fields

Instances

Eq GenString # 
IsString GenString # 
Monoid GenString # 
StringRWIO GenString #

This is minimally defined with GenStringDefault.

ConvText GenString # 
ConvLazyByteString GenString # 
ConvStrictByteString GenString # 
ConvString GenString # 
ConvGenString GenString # 
StringCells GenString # 

Associated Types

type StringCellChar GenString :: * #

type StringCellAltChar GenString :: * #

Methods

toStringCells :: StringCells s2 => GenString -> s2 #

fromStringCells :: StringCells s2 => s2 -> GenString #

cons :: StringCellChar GenString -> GenString -> GenString #

uncons :: GenString -> (StringCellChar GenString, GenString) #

snoc :: GenString -> StringCellChar GenString -> GenString #

unsnoc :: GenString -> (GenString, StringCellChar GenString) #

altCons :: StringCellAltChar GenString -> GenString -> GenString #

altUncons :: GenString -> (StringCellAltChar GenString, GenString) #

altSnoc :: GenString -> StringCellAltChar GenString -> GenString #

altUnsnoc :: GenString -> (GenString, StringCellAltChar GenString) #

toMainChar :: StringCell c => c -> Tagged * GenString (StringCellChar GenString) #

toAltChar :: StringCell c => c -> Tagged * GenString (StringCellAltChar GenString) #

append :: GenString -> GenString -> GenString #

concat :: [GenString] -> GenString #

empty :: GenString #

null :: GenString -> Bool #

head :: GenString -> StringCellChar GenString #

tail :: GenString -> GenString #

last :: GenString -> StringCellChar GenString #

init :: GenString -> GenString #

altHead :: GenString -> StringCellAltChar GenString #

altLast :: GenString -> StringCellAltChar GenString #

unfoldr :: (a -> Maybe (StringCellChar GenString, a)) -> a -> GenString #

altUnfoldr :: (a -> Maybe (StringCellAltChar GenString, a)) -> a -> GenString #

unfoldrN :: Int -> (a -> Maybe (StringCellChar GenString, a)) -> a -> GenString #

altUnfoldrN :: Int -> (a -> Maybe (StringCellAltChar GenString, a)) -> a -> GenString #

unfoldrN64 :: Int64 -> (a -> Maybe (StringCellChar GenString, a)) -> a -> GenString #

altUnfoldrN64 :: Int64 -> (a -> Maybe (StringCellAltChar GenString, a)) -> a -> GenString #

index :: GenString -> Int -> StringCellChar GenString #

index64 :: GenString -> Int64 -> StringCellChar GenString #

genericIndex :: Integral i => GenString -> i -> StringCellChar GenString #

take :: Int -> GenString -> GenString #

take64 :: Int64 -> GenString -> GenString #

genericTake :: Integral i => i -> GenString -> GenString #

drop :: Int -> GenString -> GenString #

drop64 :: Int64 -> GenString -> GenString #

genericDrop :: Integral i => i -> GenString -> GenString #

length :: GenString -> Int #

length64 :: GenString -> Int64 #

genericLength :: Integral i => GenString -> i #

safeUncons :: GenString -> Maybe (StringCellChar GenString, GenString) #

safeUnsnoc :: GenString -> Maybe (GenString, StringCellChar GenString) #

safeAltUncons :: GenString -> Maybe (StringCellAltChar GenString, GenString) #

safeAltUnsnoc :: GenString -> Maybe (GenString, StringCellAltChar GenString) #

safeHead :: GenString -> Maybe (StringCellChar GenString) #

safeTail :: GenString -> Maybe GenString #

safeLast :: GenString -> Maybe (StringCellChar GenString) #

safeInit :: GenString -> Maybe GenString #

safeAltHead :: GenString -> Maybe (StringCellAltChar GenString) #

safeAltLast :: GenString -> Maybe (StringCellAltChar GenString) #

safeIndex :: GenString -> Int -> Maybe (StringCellChar GenString) #

safeIndex64 :: GenString -> Int64 -> Maybe (StringCellChar GenString) #

safeGenericIndex :: Integral i => GenString -> i -> Maybe (StringCellChar GenString) #

safeTake :: Int -> GenString -> Maybe GenString #

safeTake64 :: Int64 -> GenString -> Maybe GenString #

safeGenericTake :: Integral i => i -> GenString -> Maybe GenString #

safeDrop :: Int -> GenString -> Maybe GenString #

safeDrop64 :: Int64 -> GenString -> Maybe GenString #

safeGenericDrop :: Integral i => i -> GenString -> Maybe GenString #

safeUncons2 :: GenString -> Maybe (StringCellChar GenString, StringCellChar GenString, GenString) #

safeUncons3 :: GenString -> Maybe (StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, GenString) #

safeUncons4 :: GenString -> Maybe (StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, GenString) #

cons2 :: StringCellChar GenString -> StringCellChar GenString -> GenString -> GenString #

cons3 :: StringCellChar GenString -> StringCellChar GenString -> StringCellChar GenString -> GenString -> GenString #

cons4 :: StringCellChar GenString -> StringCellChar GenString -> StringCellChar GenString -> StringCellChar GenString -> GenString -> GenString #

uncons2 :: GenString -> (StringCellChar GenString, StringCellChar GenString, GenString) #

uncons3 :: GenString -> (StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, GenString) #

uncons4 :: GenString -> (StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, StringCellChar GenString, GenString) #

type StringCellChar GenString # 
type StringCellAltChar GenString # 

type GenStringDefault = ByteString #

This type is used by GenString when a concrete string type is needed