[Haskell-cafe] Test on identity?

Dušan Kolář kolar at fit.vut.cz
Wed Jul 8 06:17:41 UTC 2020


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20200708/06046814/attachment.html>


More information about the Haskell-Cafe mailing list