diff options
| author | Edoardo La Greca | 2025-09-26 20:02:43 +0200 |
|---|---|---|
| committer | Edoardo La Greca | 2025-09-26 20:02:43 +0200 |
| commit | 44b1321880742c3f140ba3010432bb624406d951 (patch) | |
| tree | 1713fd93f7293a5d55537cb2126efa48ec22a537 | |
| parent | 6ca52693f1d0e4ed22633ff7ea804bdd6734742d (diff) | |
fix replaceLine function in Buffer implementation for JoinList (Score,Size) String in fourth exercise of lecture 7
| -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 0d62d94..1f356c9 100644 --- a/lec07/JoinList.hs +++ b/lec07/JoinList.hs @@ -89,7 +89,7 @@ instance Buffer (JoinList (Score, Size) String) where line = indexJ - replaceLine n ln jl = (takeJ (n-1) jl) +++ (Single (scoreString ln, 1) ln) +++ (dropJ n jl) + replaceLine n ln jl = (takeJ (n-2) jl) +++ (Single (scoreString ln, 1) ln) +++ (dropJ n jl) numLines = foldJ 0 (\_ -> 1) (\x y -> x + y) |