Or a StableName? I guess StablePtr prevents the GC to move the Haskell object, so for just doing ugly comparing StableName would be better?<div> <br><div class="gmail_quote">On Mon, Apr 20, 2009 at 12:45 AM, Lennart Augustsson <span dir="ltr"><<a href="mailto:lennart@augustsson.net">lennart@augustsson.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">And when the need gets big enough you pull out StablePtr and use that. :)<br>
<div><div></div><div class="h5"><br>
On Sun, Apr 19, 2009 at 10:43 PM, Peter Verswyvelen <<a href="mailto:bugfact@gmail.com">bugfact@gmail.com</a>> wrote:<br>
> Sometimes I do miss the pragmatic C solution:<br>
> - two function pointers that are equal surely represent the same functions<br>
> (although in C nothing is really sure ;)<br>
> - two function pointers that are different, might or might not represent<br>
> that same functions.<br>
> But this weak equality can sometimes be handy.<br>
> For example, suppose you have a predicate a -> Bool, and a list of these<br>
> predicates [a -> Bool], but you want to remove all functions that are<br>
> obviously equal in the C way from the list for optimization... Okay big<br>
> hack, and one could do this already with reallyUnsafePtrEquality# I guess...<br>
> On Sat, Apr 18, 2009 at 6:02 PM, John A. De Goes <<a href="mailto:john@n-brain.net">john@n-brain.net</a>> wrote:<br>
>><br>
>> Two functions are equal iff they have the same domain and range and the<br>
>> same outputs for the same inputs. Simple to state, but extremely difficult<br>
>> to implement in a useful way, and impossible to implement in a perfect way.<br>
>><br>
>> If you had a compiler or algorithm capable of determining function<br>
>> equality, you could use it to prove or disprove arbitrary theorems in<br>
>> mathematics.<br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<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>
><br>
</div></div></blockquote></div><br></div>