1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

🔥 sublist.

This commit is contained in:
Rob Rix 2016-03-09 01:51:39 -05:00
parent 64384f407b
commit 471449985a

View File

@ -23,10 +23,6 @@ rangeLength range = end range - start range
substring :: Range -> T.Text -> T.Text
substring range = T.take (rangeLength range) . T.drop (start range)
-- | Return the portion of the list identified by the given range.
sublist :: Range -> [a] -> [a]
sublist range = take (rangeLength range) . drop (start range)
-- | Return a range that covers the entire text.
totalRange :: Foldable f => f a -> Range
totalRange t = Range 0 $ length t