On Sat, Dec 27, 2008 at 12:44 PM, David Menendez <span dir="ltr">&lt;<a href="mailto:dave@zednenem.com">dave@zednenem.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Sat, Dec 27, 2008 at 2:24 PM, Andrew Wagner &lt;<a href="mailto:wagner.andrew@gmail.com">wagner.andrew@gmail.com</a>&gt; wrote:<br>
&gt; I&#39;m sure there&#39;s a way to do this, but it&#39;s escaping me at present. I want<br>
&gt; to do something like this:<br>
&gt;<br>
&gt; data Foo = Bar a =&gt; Foo a Bool ...<br>
&gt;<br>
&gt; That is, I want to create a new type, Foo, whose constructor takes both a<br>
&gt; Boolean and a value of a type of class Bar.<br>
<br>
</div>Try this:<br>
<br>
 &nbsp; &nbsp;{-# LANGUAGE ExistentialQuantification #-}<br>
<br>
 &nbsp; &nbsp;data Foo = forall a. Bar a =&gt; Foo a Bool</blockquote><div><br>Though for existentials, I find GADT more natural (actually I find GADT more natural in most cases):<br><br>&nbsp; data Foo where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Foo :: Bar a =&gt; a -&gt; Foo<br>
&nbsp;<br>Luke<br></div></div><br>