1
1
mirror of https://github.com/coot/free-category.git synced 2024-11-23 09:55:43 +03:00

Fixed a bug in 'uncons'

Make `Queue.uncons` perserve `Queue` invariant.
This commit is contained in:
Marcin Szamotulski 2019-09-01 12:53:14 +02:00
parent cd58b91419
commit d4966a6108

View File

@ -171,9 +171,9 @@ data ViewL f a b where
--
uncons :: Queue f a b
-> ViewL f a b
uncons (Queue NilTr NilTr _) = EmptyL
uncons (Queue (ConsTr tr f) r (ConsTr _ s)) = tr :< exec f r s
uncons _ = error "Queue.uncons: invariant violation"
uncons (Queue NilTr NilTr _) = EmptyL
uncons (Queue (ConsTr tr f) r s) = tr :< exec f r s
uncons _ = error "Queue.uncons: invariant violation"
snoc :: forall (f :: k -> k -> *) a b c.
Queue f b c