summaryrefslogtreecommitdiff
path: root/lec07/JoinList.hs
diff options
context:
space:
mode:
authorEdoardo La Greca2025-09-14 17:15:31 +0200
committerEdoardo La Greca2025-09-14 17:15:31 +0200
commitbaf67f76107a169e17bfe067fbc94e5afe175716 (patch)
tree4fb9c75b85432da39a2dfc91575cce0b236841d0 /lec07/JoinList.hs
parent769717f3da46c689331605d4ece9934ce2381703 (diff)
fix dropJ in second exercise
Diffstat (limited to 'lec07/JoinList.hs')
-rw-r--r--lec07/JoinList.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/lec07/JoinList.hs b/lec07/JoinList.hs
index 25667c7..5c1165e 100644
--- a/lec07/JoinList.hs
+++ b/lec07/JoinList.hs
@@ -38,7 +38,7 @@ dropJ n jl@(Single _ _)
dropJ n jl@(Append m jl1 jl2)
| n <= 0 = jl
| n >= m' = Empty
- | n < s1 = Append (Size $ m' - n) (dropJ n jl1) jl2
+ | n < s1 = dropJ n jl1 +++ jl2
| n >= s1 = dropJ (n - s1) jl2
where
s1 = getSize $ size $ tag jl1