Haskell Platform Proposal: add the 'text' library
Johan Tibell
johan.tibell at gmail.com
Fri Oct 8 11:16:20 EDT 2010
On Fri, Oct 8, 2010 at 11:00 AM, Ross Paterson <ross at soi.city.ac.uk> wrote:
> As far as I can see, the naming incompatibilities between the 3 packages
> are the following:
>
> text base bytestring type in text (or equivalent if absent)
> ---------------------------------------------------------------------------
> break - breakSubstring Text -> Text -> (Text, Text)
> breakBy break break (Char -> Bool) -> Text -> (Text, Text)
> breakEnd - - Text -> Text -> (Text, Text)
> - - breakEnd (Char -> Bool) -> Text -> (Text, Text)
> count - - Text -> Text -> Int
> - - count Char -> Text -> Int
> find - - Text -> Text -> [(Text, Text)]
> findBy find find (Char -> Bool) -> Text -> Maybe Char
> partitionBy partition - (Char -> Bool) -> Text -> (Text, Text)
> replicate - - Int -> Text -> Text
> - replicate replicate Int -> Char -> Text
> spanBy span span (Char -> Bool) -> Text -> (Text, Text)
> split - - Text -> Text -> [Text]
> - - split Char -> Text -> [Text]
> splitBy - splitWith (Char -> Bool) -> Text -> [Text]
> unfoldrN - - Int -> (a -> Maybe (Char, a)) -> a -> Text
> - - unfoldrN Int -> (a -> Maybe (Char, a)) -> a -> (Text, Maybe a)
> zipWith zipWith - (Char -> Char -> Char) -> Text -> Text -> Text
> - zipWith zipWith (Char -> Char -> a) -> Text -> Text -> [a]
>
> * The -By suffix has been used for predicate versions in 5 cases here,
> but not for filter and findIndex.
> * The find function has no connection with findBy. It ought to have a
> name that is the plural of the name of the break function.
Given text's focus on subsequences rather than single elements these
differences make sense to me after a quick first scan.
More information about the Libraries
mailing list