On Sat, Dec 27, 2008 at 12:44 PM, David Menendez <span dir="ltr"><<a href="mailto:dave@zednenem.com">dave@zednenem.com</a>></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 <<a href="mailto:wagner.andrew@gmail.com">wagner.andrew@gmail.com</a>> wrote:<br>
> I'm sure there's a way to do this, but it's escaping me at present. I want<br>
> to do something like this:<br>
><br>
> data Foo = Bar a => Foo a Bool ...<br>
><br>
> That is, I want to create a new type, Foo, whose constructor takes both a<br>
> Boolean and a value of a type of class Bar.<br>
<br>
</div>Try this:<br>
<br>
{-# LANGUAGE ExistentialQuantification #-}<br>
<br>
data Foo = forall a. Bar a => 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> data Foo where<br> Foo :: Bar a => a -> Foo<br>
<br>Luke<br></div></div><br>