Skip to content

Commit

Permalink
Fix mistakes in docs (gh-127)
Browse files Browse the repository at this point in the history
  • Loading branch information
bos committed Dec 22, 2015
1 parent 93f48a8 commit 824f1f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Data/Text.hs
Expand Up @@ -1188,8 +1188,9 @@ dropWhile p t@(Text arr off len) = loop 0 0
#-}

-- | /O(n)/ 'dropWhileEnd' @p@ @t@ returns the prefix remaining after
-- dropping characters that fail the predicate @p@ from the end of
-- dropping characters that satisfy the predicate @p@ from the end of
-- @t@. Subject to fusion.
--
-- Examples:
--
-- > dropWhileEnd (=='.') "foo..." == "foo"
Expand All @@ -1209,7 +1210,7 @@ dropWhileEnd p t@(Text arr off len) = loop (len-1) len
#-}

-- | /O(n)/ 'dropAround' @p@ @t@ returns the substring remaining after
-- dropping characters that fail the predicate @p@ from both the
-- dropping characters that satisfy the predicate @p@ from both the
-- beginning and end of @t@. Subject to fusion.
dropAround :: (Char -> Bool) -> Text -> Text
dropAround p = dropWhile p . dropWhileEnd p
Expand Down
6 changes: 4 additions & 2 deletions Data/Text/Lazy.hs
Expand Up @@ -1176,9 +1176,11 @@ dropWhile p t0 = dropWhile' t0
"LAZY TEXT dropWhile -> unfused" [1] forall p t.
unstream (S.dropWhile p (stream t)) = dropWhile p t
#-}

-- | /O(n)/ 'dropWhileEnd' @p@ @t@ returns the prefix remaining after
-- dropping characters that fail the predicate @p@ from the end of
-- dropping characters that satisfy the predicate @p@ from the end of
-- @t@.
--
-- Examples:
--
-- > dropWhileEnd (=='.') "foo..." == "foo"
Expand All @@ -1195,7 +1197,7 @@ dropWhileEnd p = go
{-# INLINE dropWhileEnd #-}

-- | /O(n)/ 'dropAround' @p@ @t@ returns the substring remaining after
-- dropping characters that fail the predicate @p@ from both the
-- dropping characters that satisfy the predicate @p@ from both the
-- beginning and end of @t@. Subject to fusion.
dropAround :: (Char -> Bool) -> Text -> Text
dropAround p = dropWhile p . dropWhileEnd p
Expand Down

0 comments on commit 824f1f2

Please sign in to comment.