Void type in base

David Luposchainsky dluposchainsky at googlemail.com
Wed Jul 17 21:48:21 CEST 2013


On 2013-07-17 21:27, Edward Kmett wrote:
> vacuous is mostly historical.
> 
> Back in the day it used to be implemented by an unsafeCoerce at the
> behest of Conor McBride who didn't want to pay for traversing the whole
> Functor and replacing its contents, when the types tell us that it
> shouldn't have any. This is correct if applied to a proper Functor, but
> subvertible in the presence of GADTs.
> 
> Now the Data.Void.Unsafe module provides that functionality (as
> unsafeVacuous) and vacuous itself is provided for compatibility with
> code that used it, and is left in case we ever get something in Functor
> that lets us apply newtype coercions directly to the Functor's parameter.

+1 in genereal. A few remarks:

1. We don't live in a C world. If you live in France, knowing some
English might not hurt, but nobody would say "well they say 'fish' in
English so let's call it that as well". That said, I'm neither for nor
against "Void", I'd be fine with whatever makes sense in some context,
and that C inertia should not be part of that context.

2. I'm not sure we should be concerned about backwards compatibility
when introducing a completely new module to Base. If necessary, a
compatibility lib on Hackage is enough.

David




More information about the Libraries mailing list