<br><font size=2 face="sans-serif">Hello,</font>
<br>
<br><font size=2 face="sans-serif"> You should be able to use fundeps
to do exactly what you describe below. </font>
<br>
<br><font size=2 face="sans-serif"> Can you make a relatively small
self-contained example which exemplifies the ugliness you see? </font>
<br>
<br><font size=2 face="sans-serif">-Jeff</font>
<br>
<br>
<br><tt><font size=2>haskell-cafe-bounces@haskell.org wrote on 12/07/2007
11:24:35 AM:<br>
<br>
> <br>
> I have some type-level sets using fundeps working whereby equality
and<br>
> membership etc are predicate functions. This seems to leads to an
explosion<br>
> of ugly code, with `If' class constraints etc getting out of hand
-- I want<br>
> to treat these as relations instead so providing the definition describes<br>
> everything that is 'in' and nothing that is 'out'. I've been using
Oleg's<br>
> paper on lightweight static resources [1] as a template for this.
I want to<br>
> do something like this (supposing I have an EQ relation, (:::) for
consing):<br>
> <br>
> class Member x y <br>
> instance EQ x y => Member x (y:::ys) <br>
> instance Member x ys => Member x (y:::ys)<br>
> <br>
> But I can certainly see why this isn't possible (It's the equivalent
of<br>
> pattern-matching on the constraints I suppose). Do type families provide
a<br>
> way to do this kind of thing or do I need a different strategy altogether,<br>
> involving GADTs or whatever?<br>
> <br>
> Thanks,<br>
> <br>
> [1] http://okmij.org/ftp/Computation/resource-aware-prog/tfp.pdf<br>
> -- <br>
> View this message in context: http://www.nabble.com/fundeps-and-<br>
> overlapping-undecidable-instances-tf4962996.html#a14215583<br>
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.<br>
> <br>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> Haskell-Cafe@haskell.org<br>
> http://www.haskell.org/mailman/listinfo/haskell-cafe<br>
</font></tt>
<br>
<span style="font-family:'Arial',sans-serif; font-size:8pt; color:#000000">---<br>
<br>
This e-mail may contain confidential and/or privileged information. If you <br>
are not the intended recipient (or have received this e-mail in error) <br>
please notify the sender immediately and destroy this e-mail. Any <br>
unauthorized copying, disclosure or distribution of the material in this <br>
e-mail is strictly forbidden.</span>