From 44b1321880742c3f140ba3010432bb624406d951 Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Fri, 26 Sep 2025 20:02:43 +0200 Subject: fix replaceLine function in Buffer implementation for JoinList (Score,Size) String in fourth exercise of lecture 7 --- lec07/JoinList.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lec07/JoinList.hs') 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) -- cgit v1.2.3