From 67fd5c3da4fbe9803cfbad5f9b108e3ff902f94d Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 9 Mar 2016 01:43:22 -0500 Subject: [PATCH] Generalize totalRange to arbitrary Foldables. --- src/Range.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Range.hs b/src/Range.hs index 649745d10..4b75f581c 100644 --- a/src/Range.hs +++ b/src/Range.hs @@ -28,8 +28,8 @@ sublist :: Range -> [a] -> [a] sublist range = take (rangeLength range) . drop (start range) -- | Return a range that covers the entire text. -totalRange :: T.Text -> Range -totalRange t = Range 0 $ T.length t +totalRange :: Foldable f => f a -> Range +totalRange t = Range 0 $ length t -- | Return a range that has its start and end offset by the given amount. offsetRange :: Int -> Range -> Range