on master help sign in
Rename partitionBy to partition
a4d0732Bryan O'Sullivan
Data/Text.hs+6−6
@@ -152,7 +152,7 @@ module Data.Text
152 , filter
152 , filter
153 , breakOnAll
153 , breakOnAll
154 , find
154 , find
155− , partitionBy
155+ , partition
156
156
157 -- , findSubstring
157 -- , findSubstring
158
158
@@ -1143,14 +1143,14 @@ find :: (Char -> Bool) -> Text -> Maybe Char
1143find p t = S.findBy p (stream t)
1143find p t = S.findBy p (stream t)
1144{-# INLINE find #-}
1144{-# INLINE find #-}
1145
1145
1146−-- | /O(n)/ The 'partitionBy' function takes a predicate and a 'Text',
1146+-- | /O(n)/ The 'partition' function takes a predicate and a 'Text',
1147-- and returns the pair of 'Text's with elements which do and do not
1147-- and returns the pair of 'Text's with elements which do and do not
1148-- satisfy the predicate, respectively; i.e.
1148-- satisfy the predicate, respectively; i.e.
1149--
1149--
1150−-- > partitionBy p t == (filter p t, filter (not . p) t)
1150+-- > partition p t == (filter p t, filter (not . p) t)
1151−partitionBy :: (Char -> Bool) -> Text -> (Text, Text)
1151+partition :: (Char -> Bool) -> Text -> (Text, Text)
1152−partitionBy p t = (filter p t, filter (not . p) t)
1152+partition p t = (filter p t, filter (not . p) t)
1153−{-# INLINE partitionBy #-}
1153+{-# INLINE partition #-}
1154
1154
1155-- | /O(n)/ 'filter', applied to a predicate and a 'Text',
1155-- | /O(n)/ 'filter', applied to a predicate and a 'Text',
1156-- returns a 'Text' containing those characters that satisfy the
1156-- returns a 'Text' containing those characters that satisfy the
Data/Text/Lazy.hs+6−6
@@ -157,7 +157,7 @@ module Data.Text.Lazy
157 , filter
157 , filter
158 , find
158 , find
159 , breakOnAll
159 , breakOnAll
160− , partitionBy
160+ , partition
161
161
162 -- , findSubstring
162 -- , findSubstring
163
163
@@ -1306,14 +1306,14 @@ find :: (Char -> Bool) -> Text -> Maybe Char
1306find p t = S.findBy p (stream t)
1306find p t = S.findBy p (stream t)
1307{-# INLINE find #-}
1307{-# INLINE find #-}
1308
1308
1309−-- | /O(n)/ The 'partitionBy' function takes a predicate and a 'Text',
1309+-- | /O(n)/ The 'partition' function takes a predicate and a 'Text',
1310-- and returns the pair of 'Text's with elements which do and do not
1310-- and returns the pair of 'Text's with elements which do and do not
1311-- satisfy the predicate, respectively; i.e.
1311-- satisfy the predicate, respectively; i.e.
1312--
1312--
1313−-- > partitionBy p t == (filter p t, filter (not . p) t)
1313+-- > partition p t == (filter p t, filter (not . p) t)
1314−partitionBy :: (Char -> Bool) -> Text -> (Text, Text)
1314+partition :: (Char -> Bool) -> Text -> (Text, Text)
1315−partitionBy p t = (filter p t, filter (not . p) t)
1315+partition p t = (filter p t, filter (not . p) t)
1316−{-# INLINE partitionBy #-}
1316+{-# INLINE partition #-}
1317
1317
1318-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
1318-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
1319index :: Text -> Int64 -> Char
1319index :: Text -> Int64 -> Char
tests/Properties.hs+2−2
@@ -599,8 +599,8 @@ tl_filter p = L.filter p `eqP` (unpackS . TL.filter p)
599sf_findBy q p = (L.find p . L.filter q) `eqP` (S.findBy p . S.filter q)
599sf_findBy q p = (L.find p . L.filter q) `eqP` (S.findBy p . S.filter q)
600t_find p = L.find p `eqP` T.find p
600t_find p = L.find p `eqP` T.find p
601tl_find p = L.find p `eqP` TL.find p
601tl_find p = L.find p `eqP` TL.find p
602−t_partition p = L.partition p `eqP` (unpack2 . T.partitionBy p)
602+t_partition p = L.partition p `eqP` (unpack2 . T.partition p)
603−tl_partition p = L.partition p `eqP` (unpack2 . TL.partitionBy p)
603+tl_partition p = L.partition p `eqP` (unpack2 . TL.partition p)
604
604
605sf_index p s = forAll (choose (-l,l*2))
605sf_index p s = forAll (choose (-l,l*2))
606 ((L.filter p s L.!!) `eq` S.index (S.filter p $ packS s))
606 ((L.filter p s L.!!) `eq` S.index (S.filter p $ packS s))