From 65eed49eccee30b1e5a5226b9b24dda4ab975d83 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 27 Sep 2019 11:33:13 -0400 Subject: [PATCH] slice/firstLine are total. --- src/Tags/Tagging.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Tags/Tagging.hs b/src/Tags/Tagging.hs index f25723aaa..91e669e99 100644 --- a/src/Tags/Tagging.hs +++ b/src/Tags/Tagging.hs @@ -46,13 +46,13 @@ contextualizing Blob{..} symbolsToSummarize = Streaming.mapMaybeM $ \case Exit x r -> Nothing <$ exitScope (x, r) Iden iden span docsLiteralRange -> get @[ContextToken] >>= pure . \case ((x, r):("Context", cr):_) | x `elem` symbolsToSummarize - -> Just $ Tag iden x span (firstLine (slice (Just r))) (slice (Just cr)) + -> Just $ Tag iden x span (Just (firstLine (slice r))) (Just (slice cr)) ((x, r):_) | x `elem` symbolsToSummarize - -> Just $ Tag iden x span (firstLine (slice (Just r))) (slice docsLiteralRange) + -> Just $ Tag iden x span (Just (firstLine (slice r))) (slice <$> docsLiteralRange) _ -> Nothing where - slice = fmap (stripEnd . Source.toText . Source.slice blobSource) - firstLine = fmap (T.take 180 . fst . breakOn "\n") + slice = stripEnd . Source.toText . Source.slice blobSource + firstLine = T.take 180 . fst . breakOn "\n" enterScope, exitScope :: ( Member (State [ContextToken]) sig , Carrier sig m