Idiomatic naming in libs
This commit is contained in:
@@ -44,7 +44,7 @@ expectBytes = (expected bs :
|
||||
matchBool
|
||||
(ok unit rest)
|
||||
(err errUnexpectedBytes bs)
|
||||
(bytesEq taken expected))
|
||||
(bytesEq? taken expected))
|
||||
(readBytes (bytesLength expected) bs))
|
||||
|
||||
expectU8 = (expected bs :
|
||||
@@ -54,7 +54,7 @@ expectU8 = (expected bs :
|
||||
matchBool
|
||||
(ok unit rest)
|
||||
(err errUnexpectedByte bs)
|
||||
(byteEq actual expected))
|
||||
(byteEq? actual expected))
|
||||
(readU8 bs))
|
||||
|
||||
read2 = (bs : readBytes 2 bs)
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
nothing = t
|
||||
just = x : t x
|
||||
|
||||
bytesIsNil = emptyList?
|
||||
bytesNil? = emptyList?
|
||||
|
||||
bytesHead = matchList nothing (h _ : just h)
|
||||
|
||||
bytesTail = matchList nothing (_ r : just r)
|
||||
|
||||
byteEq = equal?
|
||||
byteEq? = equal?
|
||||
bytesLength = length
|
||||
bytesAppend = append
|
||||
|
||||
@@ -38,12 +38,12 @@ bytesDrop = n bytes : bytesDrop_ n 0 bytes
|
||||
|
||||
bytesSplitAt = n bytes : pair (bytesTake n bytes) (bytesDrop n bytes)
|
||||
|
||||
bytesEq = y (self xs ys :
|
||||
bytesEq? = y (self xs ys :
|
||||
matchList
|
||||
(matchList true (_ _ : false) ys)
|
||||
(xh xt :
|
||||
matchList
|
||||
false
|
||||
(yh yt : and? (byteEq xh yh) (self xt yt))
|
||||
(yh yt : and? (byteEq? xh yh) (self xt yt))
|
||||
ys)
|
||||
xs)
|
||||
|
||||
Reference in New Issue
Block a user