octane-0.13.1: Parse Rocket League replays.

Safe HaskellNone
LanguageHaskell2010

Octane.Type.Word32

Synopsis

Documentation

newtype Word32 Source #

A 32-bit unsigned integer.

Constructors

Word32 Word32 

Instances

Eq Word32 Source # 

Methods

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

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

Num Word32 Source # 
Ord Word32 Source # 
Show Word32 Source #

Shown as 0x01020304.

>>> show (1 :: Word32)
"0x00000001"
Generic Word32 Source # 

Associated Types

type Rep Word32 :: * -> * #

Methods

from :: Word32 -> Rep Word32 x #

to :: Rep Word32 x -> Word32 #

ToJSON Word32 Source #

Encoded as a JSON number.

>>> Aeson.encode (1 :: Word32)
"1"
Binary Word32 Source #

Little-endian.

>>> Binary.decode "\x01\x00\x00\x00" :: Word32
0x00000001
>>> Binary.encode (1 :: Word32)
"\SOH\NUL\NUL\NUL"

Methods

put :: Word32 -> Put #

get :: Get Word32 #

putList :: [Word32] -> Put #

BinaryBit Word32 Source #

Little-endian with the bits in each byte reversed.

>>> Binary.runGet (BinaryBit.runBitGet (BinaryBit.getBits 0)) "\x80\x00\x00\x00" :: Word32
0x00000001
>>> Binary.runPut (BinaryBit.runBitPut (BinaryBit.putBits 0 (1 :: Word32)))
"\128\NUL\NUL\NUL"

Methods

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

getBits :: Int -> BitGet Word32 #

NFData Word32 Source # 

Methods

rnf :: Word32 -> () #

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

fromWord32 :: Integral a => Word32 -> a Source #

Converts a Word32 into any Integral value.

>>> fromWord32 0x00000001 :: Word.Word32
1
>>> fromWord32 0xffffffff :: Data.Int.Int32
-1

toWord32 :: Integral a => a -> Word32 Source #

Converts any Integral value into a Word32.

>>> toWord32 (1 :: Word.Word32)
0x00000001
>>> toWord32 (-1 :: Data.Int.Int32)
0xffffffff