mirror of
https://github.com/anoma/juvix.git
synced 2025-01-04 05:33:27 +03:00
Use nockmaEq
instead of Eq instance to detect nil
terminator (#3149)
`unfoldList` should work with for lists like: * `[5 0]` * `[5 nil]` * `[5 tag@myNilTag 0]` * etc. currently `unfoldList` will work only for list `nil` terminators that are tagged with `unfoldList`. `nockmaEq` compares nock terms ignoring debug annotations, so the above lists will work correctly.
This commit is contained in:
parent
1a8b632463
commit
4a1350a783
@ -569,7 +569,7 @@ unfoldList = ensureNockmList . nonEmpty . unfoldTuple
|
||||
Nothing -> err
|
||||
Just l -> case l ^. _unsnoc1 of
|
||||
(ini, lst)
|
||||
| lst == nockNilTagged "unfoldList" -> ini
|
||||
| nockmaEq lst (nockNilTagged "unfoldList") -> ini
|
||||
| otherwise -> err
|
||||
where
|
||||
err :: x
|
||||
|
Loading…
Reference in New Issue
Block a user