Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Getter a = Parser String a
- class Get a where
- runGet :: Get a => ByteString -> Either String (a, ByteString)
- runGetter :: Getter a -> ByteString -> Either String (a, ByteString)
- class GetWith (r :: TYPE rep) a | a -> r where
- runGetWith :: GetWith (r :: TYPE LiftedRep) a => r -> ByteString -> Either String (a, ByteString)
Documentation
Instances
Get Int8 Source # | |
Get Word8 Source # | |
Get DCS Source # | |
Get DSS Source # | |
Get DU Source # | |
Get Tar Source # | |
Get Tiff Source # | |
Get WavHeader Source # | |
Get ByteString Source # | |
Defined in Binrep.Get get :: Getter ByteString Source # | |
(bs ~ MagicVals (TiffMagic end), ByteVals bs, irep ~ I 'U 'I4 end, Get irep) => Get (TiffBody end) Source # | |
Get (AsciiNat 8) Source # | |
Get (AsByteString 'C) Source # | |
Defined in Binrep.Type.ByteString | |
(itype ~ I 'U size end, irep ~ IRep 'U size, Integral irep, Get itype) => Get (AsByteString ('Pascal size end)) Source # | |
Defined in Binrep.Type.ByteString | |
KnownSymbol str => Get (MagicUTF8 str) Source # | |
Get a => Get [a] Source # | Parse heterogeneous lists in order. No length indicator, so either fails or succeeds by reaching EOF. Probably not what you usually want, but sometimes used at the "top" of binary formats. |
Defined in Binrep.Get | |
Get a => Get (Table 'Strong a) Source # | |
KnownNat n => Get (TarNat n) Source # | |
(bs ~ MagicVals a, ByteVals bs) => Get (Magic a) Source # | Forces magic values to be individual bytes. TODO improve show - maybe hexbytestring goes here? lol |
(Get a, BLen a, KnownNat n) => Get (NullPadded n a) Source # | Safety: we assert actual length is within expected length (in order to calculate how much padding to parse). Note that the consumer probably doesn't care about the content of the padding, just that the data is chunked correctly. I figure we care about correctness here, so it'd be nice to know about the padding well-formedness (i.e. that it's all nulls). TODO maybe better definition via isolate |
Defined in Binrep.Type.NullPadded get :: Getter (NullPadded n a) Source # | |
(Get a, KnownNat n) => Get (Sized n a) Source # | |
(Get a, KnownNat n) => Get (Vector n a) Source # | |
(Get a, Get b) => Get (a, b) Source # | |
Defined in Binrep.Get | |
Get (I 'S 'I1 e) Source # | |
Get (I 'S 'I2 'BE) Source # | |
Get (I 'S 'I2 'LE) Source # | |
Get (I 'S 'I4 'BE) Source # | |
Get (I 'S 'I4 'LE) Source # | |
Get (I 'S 'I8 'BE) Source # | |
Get (I 'S 'I8 'LE) Source # | |
Get (I 'U 'I1 e) Source # | |
Get (I 'U 'I2 'BE) Source # | |
Get (I 'U 'I2 'LE) Source # | |
Get (I 'U 'I4 'BE) Source # | |
Get (I 'U 'I4 'LE) Source # | |
Get (I 'U 'I8 'BE) Source # | |
Get (I 'U 'I8 'LE) Source # | |
(itype ~ I 'U size end, irep ~ IRep 'U size, Get itype, Integral irep, Get a, KnownNat (MaxBound irep)) => Get (LenPfx size end a) Source # | |
runGet :: Get a => ByteString -> Either String (a, ByteString) Source #
runGetter :: Getter a -> ByteString -> Either String (a, ByteString) Source #
class GetWith (r :: TYPE rep) a | a -> r where Source #
A type that can be parsed from binary given some environment.
Making this levity polymorphic makes things pretty strange, but is useful.
See Binrep.Example.FileTable
.
runGetWith :: GetWith (r :: TYPE LiftedRep) a => r -> ByteString -> Either String (a, ByteString) Source #