Revert "Use thunk ID to short-circuit thunkEq"

This reverts commit c287ab8b59.
This commit is contained in:
Ken Micklas 2019-03-09 20:35:39 -05:00
parent 6a5718458d
commit 05fccda825

View file

@ -225,8 +225,14 @@ isClosureNF _ = False
thunkEq :: MonadThunk (NValue m) (NThunk m) m
=> NThunk m -> NThunk m -> m Bool
thunkEq (NThunk _ (Thunk lid _ _)) (NThunk _ (Thunk rid _ _)) | lid == rid = return True
thunkEq lt rt = force lt $ \lv -> force rt $ \rv -> valueEq lv rv
thunkEq lt rt = force lt $ \lv -> force rt $ \rv ->
case (lv, rv) of
(NVClosure _ _, NVClosure _ _) -> pure unsafePtrEq
(NVList _, NVList _) -> pure unsafePtrEq
(NVSet _ _, NVSet _ _) -> pure unsafePtrEq
_ -> valueEq lv rv
where
unsafePtrEq = True -- TODO
-- | Checks whether two containers are equal, using the given item equality
-- predicate. If there are any item slots that don't match between the two