Skip to content

Commit b283c53

Browse files
author
jared
committed
Minor documentation / variable naming improvements
1 parent 992bd40 commit b283c53

File tree

1 file changed

+6
-6
lines changed
  • lambda-buffers-codegen/src/LambdaBuffers/Codegen/LamVal

1 file changed

+6
-6
lines changed

lambda-buffers-codegen/src/LambdaBuffers/Codegen/LamVal/Eq.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ eqRecord (qtyN, recTy) =
5858
( \l ->
5959
LamE
6060
( \r ->
61-
let assocsRecTy = map (\field -> eqField qtyN field l r) $ OMap.assocs recTy
62-
in if null assocsRecTy
61+
let eqFieldExprs = map (\field -> eqField qtyN field l r) $ OMap.assocs recTy
62+
in if null eqFieldExprs
6363
then trueE
6464
else
6565
foldl1
6666
(\tot eqFieldExpr -> andE @ tot @ eqFieldExpr)
67-
assocsRecTy
67+
eqFieldExprs
6868
)
6969
)
7070

@@ -74,18 +74,18 @@ eqField qtyN (fieldName, fieldTy) l r = eqE fieldTy @ FieldE (qtyN, fieldName) l
7474
{- | 'eqListHelper' is an internal function which equates two lists of 'ValueE'
7575
with their type pairwise.
7676
77-
Invariant:
77+
Preconditions:
7878
- All input lists are the same length
7979
-}
8080
eqListHelper :: [ValueE] -> [ValueE] -> [LT.Ty] -> ValueE
8181
eqListHelper lxs rxs tys =
82-
Exception.assert invariantAssertion $
82+
Exception.assert preconditionAssertion $
8383
let eqedLxsRxsTys = map (\(lx, rx, ty) -> eqE ty @ lx @ rx) $ zip3 lxs rxs tys
8484
in if null eqedLxsRxsTys
8585
then trueE
8686
else foldl1 (\tot eqExpr -> andE @ tot @ eqExpr) eqedLxsRxsTys
8787
where
88-
invariantAssertion =
88+
preconditionAssertion =
8989
let lxsLength = length lxs
9090
rxsLength = length rxs
9191
tysLength = length tys

0 commit comments

Comments
 (0)