Idiomatic naming in libs

This commit is contained in:
2026-05-07 08:15:32 -05:00
parent 44ab13c889
commit 37d57044e2
3 changed files with 16 additions and 16 deletions

View File

@@ -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)

View File

@@ -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)