[Haskell-cafe] pointer equality

yi huang yi.codeplayer at gmail.com
Wed Jul 20 08:14:45 CEST 2011


2011/7/20 Eugene Kirpichov <ekirpichov at gmail.com>

> reallyUnsafePointerEq#, and it really is as unsafe as it sounds :)
>
> Why is it so unsafe? i can't find any documentation on it.
I think always compare pointer first is a good optimization.


>
>
> 20.07.2011, в 7:51, "Nikhil A. Patil" <patil.nikhil at gmail.com> написал(а):
>
> > Hi,
> >
> > Is there any way of getting the following code to immediately return
> > True without performing the element-by-element comparison? Essentially
> > this boils down to checking whether pointers are equal before
> > comparing the contents.
> >
> >> main = print $ f == f
> >>      where f = [1..10^9]
> >
> > Thanks!!
> >
> > nikhil
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
http://www.yi-programmer.com/blog/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110720/900d9973/attachment.htm>


More information about the Haskell-Cafe mailing list