[darcs-users] darcs patch: change the kind of the witness types
Jason Dagit
dagit at codersbase.com
Sun Sep 6 01:59:09 UTC 2009
On Wed, Sep 2, 2009 at 5:09 PM, Ganesh Sittampalam<ganesh at earth.li> wrote:
> Thu Sep 3 01:07:22 BST 2009 Ganesh Sittampalam <ganesh at earth.li>
> * change the kind of the witness types
>
> A problem with the type witnesses combined with the EqCheck type and
> unsafeCoerceP is that they can be abused to coerce concrete types. By
> changing the kind of the witnesses to something obscure (and arbitrarily
> chosen), this danger should be minimised.
>
> Unfortunately this change causes a flood of GHC warnings in the witnesses
> build caused by http://hackage.haskell.org/trac/ghc/ticket/959, and a single
> warning about an unused data constructor that I had to add because I can't
> figure out how to get empty data decls with a kind signature in GHC 6.10.4.
I like the contents of this patch, but I don't like that it adds
warnings we can't silence. Fortunately the warnings are only during
the witness build. The warning itself looks like this:
src/Darcs/Ordered.hs:85:168:
Warning: Inventing strangely-kinded Any TyCon
of kind `((* -> *)
-> (* -> * -> *)
-> *
-> (* -> * -> * -> *)
-> *)
-> *'
from an instantiation of type variable `x'
This warning can be suppressed by a type signature fixing `x'
but is harmless without -O (and usually harmless anyway).
See http://hackage.haskell.org/trac/ghc/ticket/959 for details
We don't (currently) compile the type-witness build with
optimizations. Eventually we might want to do that. So this change
still going to be harmless for us if we used -O?
Since I'm having a hard time making a decision on this patch, can
someone say something to help sway me either way?
Thanks,
Jason
More information about the darcs-users
mailing list