-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lifted sequence coercions #1
Comments
Where do I use Any? Cheers! |
O wait in LiftSequence :) |
Yep this is definitely an improvement! I'll change it. Thanks! |
I guess you'll want a kind annotation there. Probably something like newtype FakeSequence (a :: k -> k -> *) (b::k) (c::k) = FakeSequence (Seq Any) |
Any progress on this? Should I open a pull request? |
Fixed by #2ab000be1ddc49a2ec36afaaa58485df56aef654 |
I just looked at this again, and was surprised to see |
Currently, you use
data Any a where Any :: a b c -> Any a
. This has a potential efficiency problem because of the extra constructor. I'm also not sure if it's entirely safe. As best I can tell, the officially sanctioned way to do this sort of thing is with the somewhat magicalGHC.Prim.Any :: *
, which is designed as a "safe" intermediary forunsafeCoerce
. To use it, you'd just make aSeq Any
or similar, andunsafeCoerce
both on the way in and on the way out. GHC seems to promise not to play games with this type.The text was updated successfully, but these errors were encountered: