GHC 7.11 errors on dictionary casting tricks
I am not saying this is a bug, it just seems to mess with techniques that assume white-box knowledge of GHC's dictionary-passing internals.
So, I have this function (in the gdiff
fork I am fooling around with):
iFeelDirty :: (forall ts . List f ts => f t ts -> Con f t) -> (forall ts . IsList f ts -> f t ts -> Con f t)
iFeelDirty = unsafeCoerce
It compiles perfectly before 7.11, but now I get:
src/Data/Generic/Diff/Effectful.hs:139:14:
No instance for (List f ts3)
The type variable `ts3' is ambiguous
Relevant bindings include
iFeelDirty :: (forall ts. List f ts => f t ts -> Con f t)
-> forall ts. IsList f ts -> f t ts -> Con f t
(bound at src/Data/Generic/Diff/Effectful.hs:139:1)
In the expression: unsafeCoerce
In an equation for `iFeelDirty': iFeelDirty = unsafeCoerce
For reference, this is the file I am looking at: https://github.com/ggreif/gdiff/blob/97b13e2dca0c35c2c53d5430f6f0700dc89938ec/src/Data/Generic/Diff/Effectful.hs#L138
Looks like the old trick (also used by ekmett's reflection
lib?) fails to deliver.
Trac metadata
Trac field | Value |
---|---|
Version | 7.11 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |