summaryrefslogtreecommitdiff
path: root/lec07/JoinList.hs
diff options
context:
space:
mode:
authorEdoardo La Greca2025-09-26 20:02:43 +0200
committerEdoardo La Greca2025-09-26 20:02:43 +0200
commit44b1321880742c3f140ba3010432bb624406d951 (patch)
tree1713fd93f7293a5d55537cb2126efa48ec22a537 /lec07/JoinList.hs
parent6ca52693f1d0e4ed22633ff7ea804bdd6734742d (diff)
fix replaceLine function in Buffer implementation for JoinList (Score,Size) String in fourth exercise of lecture 7
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 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)