octane-0.13.2: Parse Rocket League replays.

Safe HaskellNone
LanguageHaskell2010

Octane.Type.Text

Synopsis

Documentation

newtype Text Source #

A thin wrapper around Text.

Constructors

Text Text 

Instances

Eq Text Source # 

Methods

(==) :: Text -> Text -> Bool #

(/=) :: Text -> Text -> Bool #

Ord Text Source # 

Methods

compare :: Text -> Text -> Ordering #

(<) :: Text -> Text -> Bool #

(<=) :: Text -> Text -> Bool #

(>) :: Text -> Text -> Bool #

(>=) :: Text -> Text -> Bool #

max :: Text -> Text -> Text #

min :: Text -> Text -> Text #

Show Text Source #

Shown as a string literal, like "this".

>>> show ("K" :: Text)
"\"K\""

Methods

showsPrec :: Int -> Text -> ShowS #

show :: Text -> String #

showList :: [Text] -> ShowS #

IsString Text Source #

Allows you to write Text as string literals with OverloadedStrings. Also allows using the fromString helper function.

>>> "K" :: Text
"K"

Methods

fromString :: String -> Text #

Generic Text Source # 

Associated Types

type Rep Text :: * -> * #

Methods

from :: Text -> Rep Text x #

to :: Rep Text x -> Text #

ToJSON Text Source #

Encoded directly as a JSON string.

>>> Aeson.encode ("K" :: Text)
"\"K\""
Binary Text Source #

Text is both length-prefixed and null-terminated.

>>> Binary.decode "\x02\x00\x00\x00\x4b\x00" :: Text
"K"
>>> Binary.encode ("K" :: Text)
"\STX\NUL\NUL\NULK\NUL"

Methods

put :: Text -> Put #

get :: Get Text #

putList :: [Text] -> Put #

BinaryBit Text Source #

Both length-prefixed and null-terminated. The bits in each byte are reversed.

>>> Binary.runGet (BinaryBit.runBitGet (BinaryBit.getBits 0)) "\x40\x00\x00\x00\xd2\x00" :: Text
"K"
>>> Binary.runPut (BinaryBit.runBitPut (BinaryBit.putBits 0 ("K" :: Text)))
"@\NUL\NUL\NUL\210\NUL"

Methods

putBits :: Int -> Text -> BitPut () #

getBits :: Int -> BitGet Text #

NFData Text Source # 

Methods

rnf :: Text -> () #

type Rep Text Source # 
type Rep Text = D1 (MetaData "Text" "Octane.Type.Text" "octane-0.13.2-Jhh2dCvgfd3Aq8n4T2jPT6" True) (C1 (MetaCons "Text" PrefixI True) (S1 (MetaSel (Just Symbol "unpack") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

encodeLatin1 :: Text -> ByteString Source #

Encodes text as Latin-1. Note that this isn't really safe if the text has characters that can't be encoded in Latin-1.

>>> encodeLatin1 "A"
"A"