Proposal: Deprecate decodeUtf8
Niklas Hambüchen
mail at nh2.me
Fri Aug 19 02:55:41 UTC 2016
My idea was to use DEPRECATED to indicate that it comes from a time
where partial functions were considered OK, but this is no longer common
practice now.
WARNING would work just as well though, I'd have no preference between
the two.
On 18/08/16 23:13, evan at evan-borden.com wrote:
> If the intent is to keep this function indefinitely then why abuse
> DEPRECATED? Why not utilize WARNING?
>
> On Thu, Aug 18, 2016 at 7:50 AM, Oleg Grenrus <oleg.grenrus at iki.fi
> <mailto:oleg.grenrus at iki.fi>> wrote:
>
> So (as also pointed by Edward):
>
> - Some people are aware that decodeUtf8 is partial and rely on that
> behaviour
> - Some people aren’t aware, and think that decodeUtf8 is like
> `decodeUtf8With lenientDecode` or `decodeUtf8With ignore`.
>
> Then if we add a {-# DEPRECATED #-} warning on `decodeUtf8`, we
> should add variants for both use cases
>
> lenientDecodeUtf8 which is total, and
> unsafeDecodeUtf8 or strictDecodeUtf8, which is what decodeUtf8 does
> today.
>
> I’d like the new names, for convenience, `OnDecodeError` values
> would require a new module import.
>
> - Oleg
>
>
> > On 18 Aug 2016, at 14:40, Niklas Hambüchen <mail at nh2.me
> <mailto:mail at nh2.me>> wrote:
> >
> > On 18/08/16 18:11, Oleg Grenrus wrote:
> >> Or should it be changed
> >>
> >> - decodeUtf8 = decodeUtf8With strictDecode
> >> + decodeUtf8 = decodeUtf8With lenientDecode
> >
> > I'd be very upset for that kind of a semantics change to sneak in
> under me.
> >
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org <mailto:Libraries at haskell.org>
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> <http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries>
>
>
More information about the Libraries
mailing list