on master help sign in
Fix mistakes in docs (gh-127)
commit824f1f2c0ed380c074265a900d5f69fc4e1cb1c5 authorBryan O'Sullivan <bos@serpentine.com> dateTue 22 Dec 2015, 11:16 (11 years ago) parent93f48a8
2 files changed+7−4
Data/Text.hs+3−2 Data/Text/Lazy.hs+4−2
Data/Text.hs+3−2
@@ -1188,8 +1188,9 @@ dropWhile p t@(Text arr off len) = loop 0 0
11881188 #-}
11891189
11901190-- | /O(n)/ 'dropWhileEnd' @p@ @t@ returns the prefix remaining after
1191−-- dropping characters that fail the predicate @p@ from the end of
1191+-- dropping characters that satisfy the predicate @p@ from the end of
11921192-- @t@. Subject to fusion.
1193+--
11931194-- Examples:
11941195--
11951196-- > dropWhileEnd (=='.') "foo..." == "foo"
@@ -1209,7 +1210,7 @@ dropWhileEnd p t@(Text arr off len) = loop (len-1) len
12091210 #-}
12101211
12111212-- | /O(n)/ 'dropAround' @p@ @t@ returns the substring remaining after
1212−-- dropping characters that fail the predicate @p@ from both the
1213+-- dropping characters that satisfy the predicate @p@ from both the
12131214-- beginning and end of @t@. Subject to fusion.
12141215dropAround :: (Char -> Bool) -> Text -> Text
12151216dropAround p = dropWhile p . dropWhileEnd p
Data/Text/Lazy.hs+4−2
@@ -1176,9 +1176,11 @@ dropWhile p t0 = dropWhile' t0
11761176"LAZY TEXT dropWhile -> unfused" [1] forall p t.
11771177 unstream (S.dropWhile p (stream t)) = dropWhile p t
11781178 #-}
1179+
11791180-- | /O(n)/ 'dropWhileEnd' @p@ @t@ returns the prefix remaining after
1180−-- dropping characters that fail the predicate @p@ from the end of
1181+-- dropping characters that satisfy the predicate @p@ from the end of
11811182-- @t@.
1183+--
11821184-- Examples:
11831185--
11841186-- > dropWhileEnd (=='.') "foo..." == "foo"
@@ -1195,7 +1197,7 @@ dropWhileEnd p = go
11951197{-# INLINE dropWhileEnd #-}
11961198
11971199-- | /O(n)/ 'dropAround' @p@ @t@ returns the substring remaining after
1198−-- dropping characters that fail the predicate @p@ from both the
1200+-- dropping characters that satisfy the predicate @p@ from both the
11991201-- beginning and end of @t@. Subject to fusion.
12001202dropAround :: (Char -> Bool) -> Text -> Text
12011203dropAround p = dropWhile p . dropWhileEnd p