diff options
| author | Edoardo La Greca | 2025-09-14 17:15:31 +0200 |
|---|---|---|
| committer | Edoardo La Greca | 2025-09-14 17:15:31 +0200 |
| commit | baf67f76107a169e17bfe067fbc94e5afe175716 (patch) | |
| tree | 4fb9c75b85432da39a2dfc91575cce0b236841d0 | |
| parent | 769717f3da46c689331605d4ece9934ce2381703 (diff) | |
fix dropJ in second exercise
| -rw-r--r-- | lec07/JoinList.hs | 2 |
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 |