[Haskell-cafe] Test on identity?
Simon Jakobi
simon.jakobi at googlemail.com
Wed Jul 8 15:48:40 UTC 2020
Hi Dusan,
containers uses pointer equality in some places:
https://github.com/haskell/containers/search?q=ptrEq&unscoped_q=ptrEq
I'd suggest to read up on reallyUnsafePtrEquality#, before you rely on
it though.
Hope that helps!
Simon
Am Mi., 8. Juli 2020 um 08:18 Uhr schrieb Dušan Kolář <kolar at fit.vut.cz>:
>
> Dear Café,
>
>
> I'm trying to build a DAG from a binary tree. I don't think there's a big trouble. Nevertheless, I do even some transformations. Thus, I would like to know it is still a DAG, not adding, accidentally, a node.
>
>
> Is there any way, if I have data like
>
>
> data Ex
>
> = Val Int
>
> | Add Ex Ex
>
>
>
> so that I can test that some value Val i === Val i ? I mean, the pointers go to the same data box? I could do that via some IORefs, AFAIK, but I don't think it is feasible. Maybe to tune the algorithm...
>
>
> Best regards,
>
>
> Dusan
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
More information about the Haskell-Cafe
mailing list