<div dir="ltr">Thanks!<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 28, 2014 at 7:36 PM, Richard Eisenberg <span dir="ltr"><<a href="mailto:eir@cis.upenn.edu" target="_blank">eir@cis.upenn.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Promoted data constructors aren't imported/exported separately from the normal data constructors. So, to use a promoted data constructor in an importing module, you need to import the normal data constructor and then promote it, with DataKinds.<br>

<br>
But, here is a workaround:<br>
<br>
> {-# LANGUAGE DataKinds #-}<br>
<div class="">> data Foo = Bar | Baz<br>
</div>> type Bar = 'Bar<br>
> type Baz = 'Baz<br>
<br>
This defines (normal, not promoted) type synonyms for the promoted data constructors. Because the namespace for types and the one for data constructors are distinct, you can even reuse the same names. In a quick test, an importing module was able to use these without DataKinds specified.<br>

<br>
I hope this helps!<br>
Richard<br>
<div><div class="h5"><br>
On Feb 28, 2014, at 12:28 PM, Corentin Dupont wrote:<br>
<br>
> Hi Cafe,<br>
> I create kinds using the DataKinds extension:<br>
><br>
> {-# LANGUAGE DataKinds #-}<br>
><br>
> module MyModule where<br>
><br>
> data Foo = Bar | Baz<br>
><br>
> The problem is that the generated Bar and Baz type constructors are not exported!<br>
> I am obliged to put the pragma DataKinds in every package that uses MyModule (a lot).<br>
> Is there a way to avoid that?<br>
><br>
> Thanks!<br>
> Corentin<br>
><br>
</div></div>> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br>
</blockquote></div><br></div>