How do I make a constraint tuple in Core?

Matthew Pickering matthewtpickering at
Tue Jun 19 14:07:14 UTC 2018

How about `tc_tuple`?

On Tue, Jun 19, 2018 at 2:53 PM, Ryan Scott < at> wrote:
> 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 [1], 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 [2]), then hackily treats them as constraint
> tuples, as explained in Note [Extra-constraint holes in partial type
> signatures] [3]. I tried reading that Note, but I couldn't follow the
> details.
> Is there a simpler way to create a constraint tuple that I'm not aware of?
> Ryan S.
> -----
> [1]
> [2]
> [3]
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at

More information about the ghc-devs mailing list