<p dir="ltr">Hi Joachim,</p>
<p dir="ltr">I used the following in the past:</p>
<p dir="ltr">module M (PublicClass(..)) where</p>
<p dir="ltr">class HiddenClass a</p>
<p dir="ltr">class HiddenClass a => PublicClass a where<br>
...</p>
<p dir="ltr">instance HiddenClass SomeType</p>
<p dir="ltr">instance PublicClass SomeType where <br>
...</p>
<p dir="ltr">Now users of M can't declare instances of PublicClass because they don't have its superclass HiddenClass in scope.</p>
<p dir="ltr">Regards,</p>
<p dir="ltr">Bas</p>
<div class="gmail_quote">On Aug 17, 2013 8:10 PM, "Joachim Breitner" <<a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
for some reason I was under the impression that if I don’t export the<br>
methods of a class, then no user of my module can create instances. But<br>
I was wrong and in fact they can; the methods will just all be bound to<br>
"error ...".<br>
<br>
Is there really no way to create a class so that no-one else can create<br>
any instances?<br>
<br>
Greetings,<br>
Joachim<br>
<br>
--<br>
Joachim “nomeata” Breitner<br>
<a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a> • <a href="http://www.joachim-breitner.de/" target="_blank">http://www.joachim-breitner.de/</a><br>
Jabber: <a href="mailto:nomeata@joachim-breitner.de">nomeata@joachim-breitner.de</a> • GPG-Key: 0x4743206C<br>
Debian Developer: <a href="mailto:nomeata@debian.org">nomeata@debian.org</a><br>
<br>
<br>_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
<br></blockquote></div>