Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Documentation
Types which may be used as prefixes.
Generally, these will be integer types.
Note that this is separate to binary representation, so endianness is irrelevant.
Note that we are also limited by the host architecture's Int
type.
We don't try to work around this, because most types are indexed with Int
s,
so I think other things will break before we do.
used by put. guaranteed that it fits from refined. that is, lenToPfx <= Max.
used by get. better not lie.
Instances
Prefix Word16 Source # | |
Prefix Word32 Source # | |
Prefix Word64 Source # | |
Prefix Word8 Source # | |
Prefix () Source # | Length prefixing with the unit means a length of 0. This is the only sensible case. 1 doesn't work because refining checks I think there are laws here, where using this is the same as doing nothing at all. |
Prefix a => Prefix (ByteOrdered end a) Source # | |
Defined in Binrep.Util.Prefix type Max (ByteOrdered end a) :: Natural Source # lenToPfx :: Int -> ByteOrdered end a Source # pfxToLen :: ByteOrdered end a -> Int Source # |