Fully normalized top-level definitions
This commit is contained in:
@@ -56,7 +56,6 @@ expectU8 = (expected bs :
|
||||
|
||||
read2 = (bs : readBytes 2 bs)
|
||||
read4 = (bs : readBytes 4 bs)
|
||||
readU16BEBytes = (bs : read2 bs)
|
||||
readU32BEBytes = (bs : read4 bs)
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
@@ -105,14 +104,3 @@ eof? = (bs :
|
||||
(emptyList? bs))
|
||||
|
||||
expectAscii = expectBytes
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Endian / int conversion helpers
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
u16BE = bytes : add (mul 256 (head bytes)) (head (tail bytes))
|
||||
|
||||
u16LE = bytes : add (mul 256 (head (tail bytes))) (head bytes)
|
||||
|
||||
readU16BE = bs : bindParser read2 (bytes rest : ok (u16BE bytes) rest) bs
|
||||
readU16LE = bs : bindParser read2 (bytes rest : ok (u16LE bytes) rest) bs
|
||||
|
||||
Reference in New Issue
Block a user