on master help sign in
Rename partitionBy to partition
commita4d0732bf419ffb5f8802c9ea2b80631ed00702d authorBryan O'Sullivan <bos@serpentine.com> dateMon 8 Nov 2010, 14:13 (16 years ago) parent6fa1d91
3 files changed+14−14
Data/Text.hs+6−6 Data/Text/Lazy.hs+6−6 tests/Properties.hs+2−2
Data/Text.hs+6−6
@@ -152,7 +152,7 @@ module Data.Text
152152 , filter
153153 , breakOnAll
154154 , find
155− , partitionBy
155+ , partition
156156
157157 -- , findSubstring
158158
@@ -1143,14 +1143,14 @@ find :: (Char -> Bool) -> Text -> Maybe Char
11431143find p t = S.findBy p (stream t)
11441144{-# INLINE find #-}
11451145
1146−-- | /O(n)/ The 'partitionBy' function takes a predicate and a 'Text',
1146+-- | /O(n)/ The 'partition' function takes a predicate and a 'Text',
11471147-- and returns the pair of 'Text's with elements which do and do not
11481148-- satisfy the predicate, respectively; i.e.
11491149--
1150−-- > partitionBy p t == (filter p t, filter (not . p) t)
1151−partitionBy :: (Char -> Bool) -> Text -> (Text, Text)
1152−partitionBy p t = (filter p t, filter (not . p) t)
1153−{-# INLINE partitionBy #-}
1150+-- > partition p t == (filter p t, filter (not . p) t)
1151+partition :: (Char -> Bool) -> Text -> (Text, Text)
1152+partition p t = (filter p t, filter (not . p) t)
1153+{-# INLINE partition #-}
11541154
11551155-- | /O(n)/ 'filter', applied to a predicate and a 'Text',
11561156-- returns a 'Text' containing those characters that satisfy the
Data/Text/Lazy.hs+6−6
@@ -157,7 +157,7 @@ module Data.Text.Lazy
157157 , filter
158158 , find
159159 , breakOnAll
160− , partitionBy
160+ , partition
161161
162162 -- , findSubstring
163163
@@ -1306,14 +1306,14 @@ find :: (Char -> Bool) -> Text -> Maybe Char
13061306find p t = S.findBy p (stream t)
13071307{-# INLINE find #-}
13081308
1309−-- | /O(n)/ The 'partitionBy' function takes a predicate and a 'Text',
1309+-- | /O(n)/ The 'partition' function takes a predicate and a 'Text',
13101310-- and returns the pair of 'Text's with elements which do and do not
13111311-- satisfy the predicate, respectively; i.e.
13121312--
1313−-- > partitionBy p t == (filter p t, filter (not . p) t)
1314−partitionBy :: (Char -> Bool) -> Text -> (Text, Text)
1315−partitionBy p t = (filter p t, filter (not . p) t)
1316−{-# INLINE partitionBy #-}
1313+-- > partition p t == (filter p t, filter (not . p) t)
1314+partition :: (Char -> Bool) -> Text -> (Text, Text)
1315+partition p t = (filter p t, filter (not . p) t)
1316+{-# INLINE partition #-}
13171317
13181318-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
13191319index :: Text -> Int64 -> Char
tests/Properties.hs+2−2
@@ -599,8 +599,8 @@ tl_filter p = L.filter p `eqP` (unpackS . TL.filter p)
599599sf_findBy q p = (L.find p . L.filter q) `eqP` (S.findBy p . S.filter q)
600600t_find p = L.find p `eqP` T.find p
601601tl_find p = L.find p `eqP` TL.find p
602−t_partition p = L.partition p `eqP` (unpack2 . T.partitionBy p)
603−tl_partition p = L.partition p `eqP` (unpack2 . TL.partitionBy p)
602+t_partition p = L.partition p `eqP` (unpack2 . T.partition p)
603+tl_partition p = L.partition p `eqP` (unpack2 . TL.partition p)
604604
605605sf_index p s = forAll (choose (-l,l*2))
606606 ((L.filter p s L.!!) `eq` S.index (S.filter p $ packS s))