Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
class (Monoid a, IsString a) => StringLike a where Source #
Data types that can be used as a list-like structure of Char
s.
Clumsy solution to allow parameterising over the input type (Text,
ByteString, String), rather than converting to and from an internal concrete
type. Only operations required by the reprinting algorithm are included.
Where possible, operations are prefilled using presumed-existing instances
(any [Char]
-like should be a monoid and have a String -> a
).
slCons :: Char -> a -> a Source #
slUncons :: a -> Maybe (Char, a) Source #
slToString :: a -> String Source #
like unpack
Instances
StringLike ByteString Source # | |
Defined in Text.Reprinter.StringLike slCons :: Char -> ByteString -> ByteString Source # slUncons :: ByteString -> Maybe (Char, ByteString) Source # slNull :: ByteString -> Bool Source # slReverse :: ByteString -> ByteString Source # slToString :: ByteString -> String Source # | |
StringLike ByteString Source # | |
Defined in Text.Reprinter.StringLike slCons :: Char -> ByteString -> ByteString Source # slUncons :: ByteString -> Maybe (Char, ByteString) Source # slNull :: ByteString -> Bool Source # slReverse :: ByteString -> ByteString Source # slToString :: ByteString -> String Source # | |
StringLike Text Source # | |
StringLike Text Source # | |
a ~ Char => StringLike [a] Source # | |
Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).
fromString :: String -> a #
Instances
IsString ByteString | Beware: |
Defined in Data.ByteString.Lazy.Internal fromString :: String -> ByteString # | |
IsString ByteString | Beware: |
Defined in Data.ByteString.Internal fromString :: String -> ByteString # | |
a ~ Char => IsString [a] |
Since: base-2.1 |
Defined in Data.String fromString :: String -> [a] # | |
IsString a => IsString (Identity a) | Since: base-4.9.0.0 |
Defined in Data.String fromString :: String -> Identity a # | |
IsString a => IsString (Const a b) | Since: base-4.9.0.0 |
Defined in Data.String fromString :: String -> Const a b # |