octane-0.13.1: Parse Rocket League replays.

Safe HaskellNone
LanguageHaskell2010

Octane.Type.Dictionary

Synopsis

Documentation

newtype Dictionary a Source #

A mapping between text and arbitrary values.

Constructors

Dictionary (Map Text a) 

Instances

IsList (Dictionary a) Source #

Allows creating Dictionary values with fromList. Also allows Dictionary literals with the OverloadedLists extension.

>>> [("one", 1)] :: Dictionary Int
fromList [("one",1)]

Associated Types

type Item (Dictionary a) :: * #

Eq a => Eq (Dictionary a) Source # 

Methods

(==) :: Dictionary a -> Dictionary a -> Bool #

(/=) :: Dictionary a -> Dictionary a -> Bool #

Show a => Show (Dictionary a) Source #

Shown as fromList [("key","value")].

>>> show ([("one", 1)] :: Dictionary Int)
"fromList [(\"one\",1)]"
Generic (Dictionary a) Source # 

Associated Types

type Rep (Dictionary a) :: * -> * #

Methods

from :: Dictionary a -> Rep (Dictionary a) x #

to :: Rep (Dictionary a) x -> Dictionary a #

ToJSON a => ToJSON (Dictionary a) Source #

Encoded directly as a JSON object.

>>> Aeson.encode ([("one", 1)] :: Dictionary Int)
"{\"one\":1}"
Binary a => Binary (Dictionary a) Source #

Elements are stored with the key first, then the value. The dictionary ends when a key is None.

>>> Binary.decode "\x02\x00\x00\x00k\x00\x01\x05\x00\x00\x00None\x00" :: Dictionary Word8
fromList [("k",0x01)]
>>> Binary.encode ([("k", 1)] :: Dictionary Word8)
"\STX\NUL\NUL\NULk\NUL\SOH\ENQ\NUL\NUL\NULNone\NUL"

Methods

put :: Dictionary a -> Put #

get :: Get (Dictionary a) #

putList :: [Dictionary a] -> Put #

NFData a => NFData (Dictionary a) Source # 

Methods

rnf :: Dictionary a -> () #

type Rep (Dictionary a) Source # 
type Rep (Dictionary a) = D1 (MetaData "Dictionary" "Octane.Type.Dictionary" "octane-0.13.1-LDgcSqYqu1AFVuudsUsa9X" True) (C1 (MetaCons "Dictionary" PrefixI True) (S1 (MetaSel (Just Symbol "unpack") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Text a))))
type Item (Dictionary a) Source # 
type Item (Dictionary a) = (Text, a)