Proposal: Deprecate decodeUtf8

Edward Kmett ekmett at gmail.com
Thu Aug 18 11:38:01 UTC 2016


Ultimately any decision made would be made by the maintainer of the
library, even if text were a core library. The library submissions process
is to help inform a decision by the package maintainer by informing them of
community preferences and to get the discussion out in the open where more
people can talk about it and raise issues -- it isn't binding.

While text isn't a "core library", it has been part of the platform for a
long time, and this is a good place to at least start the discussion around
any changes to it. Bryan remains of course free to accept of reject the
proposals that come to him.

-Edward


On Thu, Aug 18, 2016 at 7:28 AM, Yuras Shumovich <shumovichy at gmail.com>
wrote:

>
> Hi Niklas,
>
> AFAIK `text` is not maintained by CLC:
> https://wiki.haskell.org/Library_submissions#The_Core_Libraries
> (Please correct me if I'm wrong)
>
> You should probably work directly with the maintainer, e.g. open an
> issue. I think it is OK to discuss it on the list, but it should be
> clear that the maintainer is free to ignore any decision made here.
>
> Thanks,
> Yuras.
>
> On Thu, 2016-08-18 at 17:08 +0800, Niklas Hambüchen wrote:
> > I propose to add a deprecation pragma to the partial function
> > Data.Text.decodeUtf8.
> >
> > I see checks or decoding failure accidentally omitted from production
> > code every week. I claim decodeUtf8 to be *the* most abused partial
> > function in the current Haskell ecosystem (with `head` and `tail` at
> > least everybody knows they should feel bad when typing them down).
> >
> > decodeUtf8' with custom error message is a better solution in all
> > cases
> > I have seen and can come up with.
> >
> > I therefore propose:
> >
> >   * Add deprecation pragma to decodeUtf8
> >   * Do it with Text.Lazy and *16/*32 functions too
> >   * But keep them indefinitely (we don't want to break compiles)
> >
> > I believe that deprecating decodeUtf8 will result in lots of useful
> > warnings across the world every day and less software crashing at
> > runtime.
> >
> > Discussion period 2 months.
> >
> > Thanks!
> > _______________________________________________
> > Libraries mailing list
> > Libraries at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160818/f35bed2d/attachment-0001.html>


More information about the Libraries mailing list