How do I make a constraint tuple in Core?
ryan.gl.scott at gmail.com
Tue Jun 19 13:53:20 UTC 2018
I'm currently working on some code in which I need to produce a Core Type
that mentions a constraint tuple. I thought that there must surely exist
some way to construct a constraint tuple using the GHC API, but to my
astonishment, I could not find anything. The closest thing I found was
mk_tuple , which gives you the ability to make boxed and unboxed tuples,
but not constraint tuples.
I then thought to myself, "But wait, PartialTypeSignatures has to create
constraint tuples, right? How does that part of the code work?" To my
horror, I discovered that PartialTypeSignatures actually creates *boxed*
tuples (see mk_ctuple here ), then hackily treats them as constraint
tuples, as explained in Note [Extra-constraint holes in partial type
signatures] . I tried reading that Note, but I couldn't follow the
Is there a simpler way to create a constraint tuple that I'm not aware of?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs