Proposal: Deprecate decodeUtf8

Oleg Grenrus oleg.grenrus at iki.fi
Thu Aug 18 11:50:23 UTC 2016


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> 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.
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160818/ce8d3797/attachment.sig>


More information about the Libraries mailing list