<div dir="ltr">Hello,<div><br></div><div style>I was trying to add a new compulsory-unfoldable primitive (i.e., one like `<font face="courier new, monospace">unsafeCoerce</font>` in `<font face="courier new, monospace">basicTypes/MkId.hs`</font>), but I got stuck while trying to construct its type.  The primitive needs to have this type:</div>
<div style><br></div><div style><font face="courier new, monospace">    natSingI :: Sing a -&gt; (SingI a =&gt; b) -&gt; b</font></div><div style><br></div><div style>`<font face="courier new, monospace">Sing</font>` is a kind polymorphic data family.</div>
<div style>`<font face="courier new, monospace">SingI</font>` is a kind polymorphic class.</div><div style><br></div><div style>I am using these at kind `<font face="courier new, monospace">Nat</font>` so, I believe, the fully-explicit type that I need to construct is actually this:</div>
<div style><br></div><div style><font face="courier new, monospace">    natSingI :: forall (a :: Nat) (b :: *). Sing Nat a -&gt; (SingI Nat a -&gt; b) -&gt; b</font><br></div><div style><font face="courier new, monospace"><br>
</font></div><div style>I can almost create this type, but I got stuck on making the `<font face="courier new, monospace">SingI</font>` type constructor.  While there are many examples of making `<font face="courier new, monospace">Name</font>`s for classes, I couldn&#39;t find one where we make a `<font face="courier new, monospace">TyCon</font>` for a class.  In particular, it looks like to make a class `<font face="courier new, monospace">TyCon</font>`, I need to provide a `<font face="courier new, monospace">Class</font>` value, which contains a whole lot of information that would normally be constructed by the compiler itself (class `<font face="courier new, monospace">SingI</font>` is an ordinary class defined in source code).</div>
<div style><br></div><div style>So I was wondering if there might be a way to obtain this information in some way or if, indeed, I need to define explicitly the entire class as a wired-in thing.</div><div style><br></div>
<div style>Any advice would be most appreciated!</div><div style>-Iavor</div><div style><br></div></div>