Cabal-2.0.1.0: A framework for packaging Haskell software

Safe Haskell | None
Language | Haskell2010

Distribution.Utils.ShortText

Contents

- `ShortText` type
- internal utilities

Synopsis

- data ShortText
- toShortText :: String -> ShortText
- fromShortText :: ShortText -> String
- decodeStringUtf8 :: [Word8] -> String
- encodeStringUtf8 :: String -> [Word8]

# `ShortText` type

data ShortText #

Compact representation of short `Strings`

The data is stored internally as UTF8 in an `ShortByteString` when compiled against `bytestring >= 0.10.4`, and otherwise the fallback is to use plain old non-compat '[Char]'.

Note: This type is for internal uses (such as e.g. `PackageName`) and shall not be exposed in Cabal's API

Since: 2.0.0.2

Instances

Eq ShortText # |
Methods (==) :: ShortText -> ShortText -> Bool # (/=) :: ShortText -> ShortText -> Bool #
Data ShortText # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ShortText -> c ShortText Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ShortText Source #

toConstr :: ShortText -> Constr Source #

dataTypeOf :: ShortText -> DataType Source #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ShortText) Source #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ShortText) Source #

gmapT :: (forall b. Data b => b -> b) -> ShortText -> ShortText Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ShortText -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ShortText -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ShortText -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ShortText -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ShortText -> m ShortText Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ShortText -> m ShortText Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ShortText -> m ShortText Source #

Ord ShortText # |
Methods compare :: ShortText -> ShortText -> Ordering # (<) :: ShortText -> ShortText -> Bool # (<=) :: ShortText -> ShortText -> Bool # (>) :: ShortText -> ShortText -> Bool # (>=) :: ShortText -> ShortText -> Bool # max :: ShortText -> ShortText -> ShortText # min :: ShortText -> ShortText -> ShortText #
Read ShortText # |
Methods readsPrec :: Int -> ReadS ShortText Source # readList :: ReadS [ShortText] Source # readPrec :: ReadPrec ShortText Source # readListPrec :: ReadPrec [ShortText] Source #
Show ShortText # |
Methods showsPrec :: Int -> ShortText -> ShowS Source # show :: ShortText -> String Source # showList :: [ShortText] -> ShowS Source #
IsString ShortText # |
Methods fromString :: String -> ShortText Source #
Generic ShortText # |
Associated Types type Rep ShortText :: * -> * Source # Methods from :: ShortText -> Rep ShortText x Source # to :: Rep ShortText x -> ShortText Source #
Semigroup ShortText # |
Methods (<>) :: ShortText -> ShortText -> ShortText Source # sconcat :: NonEmpty ShortText -> ShortText Source # stimes :: Integral b => b -> ShortText -> ShortText Source #
Monoid ShortText # |
Methods mempty :: ShortText Source # mappend :: ShortText -> ShortText -> ShortText Source # mconcat :: [ShortText] -> ShortText Source #
NFData ShortText # |
Methods rnf :: ShortText -> () Source #
Binary ShortText # |
Methods put :: ShortText -> Put Source # get :: Get ShortText Source # putList :: [ShortText] -> Put Source #
type Rep ShortText # |
type Rep ShortText = D1 * (MetaData "ShortText" "Distribution.Utils.ShortText" "Cabal-2.0.1.0" True) (C1 * (MetaCons "ST" PrefixI True) (S1 * (MetaSel (Just Symbol "unST") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ShortByteString)))

toShortText :: String -> ShortText #

Construct `ShortText` from `String`

fromShortText :: ShortText -> String #

Convert `ShortText` to `String`

# internal utilities

decodeStringUtf8 :: [Word8] -> String #

Decode `String` from UTF8-encoded octets.

Invalid data will be decoded as the replacement character (`U+FFFD`)

See also `encodeStringUtf8`

encodeStringUtf8 :: String -> [Word8] #

Encode `String` to a list of UTF8-encoded octets

See also `decodeUtf8`