on master help sign in
fix takeEnd and dropEnd - issue #176
01bcbbeKubo Kovac
Data/Text.hs+1−1
@@ -1099,8 +1099,8 @@ takeEnd n t@(Text arr off len)
1099iterNEnd :: Int -> Text -> Int
1099iterNEnd :: Int -> Text -> Int
1100iterNEnd n t@(Text _arr _off len) = loop (len-1) n
1100iterNEnd n t@(Text _arr _off len) = loop (len-1) n
1101 where loop i !m
1101 where loop i !m
1102+ | m <= 0 = i+1
1102 | i <= 0 = 0
1103 | i <= 0 = 0
1103− | m <= 1 = i
1104 | otherwise = loop (i+d) (m-1)
1104 | otherwise = loop (i+d) (m-1)
1105 where d = reverseIter_ t i
1105 where d = reverseIter_ t i
1106
1106