From 4986269ea05c7859c71798c202439850b4fded88 Mon Sep 17 00:00:00 2001 From: Jamie Willis Date: Wed, 1 Feb 2023 18:30:23 +0000 Subject: [PATCH] Corrected sequence normalisation with `pure` (#162) --- .../internal/deepembedding/backend/SequenceEmbedding.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/SequenceEmbedding.scala b/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/SequenceEmbedding.scala index d39707d68..30a87f0ad 100644 --- a/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/SequenceEmbedding.scala +++ b/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/SequenceEmbedding.scala @@ -186,7 +186,7 @@ private [deepembedding] final class Seq[A](private [backend] var before: DoublyL after.clear() mergeFromRight(p, chooseInto(r)) // shift pure to the right by swapping before and after (before is empty linked list!) - case (_: Pure[_]) <** _ => + case (_: Pure[_]) <* _ => assume(before.isEmpty, "empty can reuse before instead of allocating a new list because before is empty") val empty = before before = after