Pointer equality in Haskell?

后端 未结 6 622
梦如初夏
梦如初夏 2020-12-10 04:12

Is there any notion of pointer quality in Haskell? == requires things to be deriving Eq, and I have something which contains a (Value -> IO Value), and neither -> nor IO der

6条回答
  •  半阙折子戏
    2020-12-10 05:06

    IORefs derive Eq. I don't understand what else you need to get the pointer equality of.

    Edit: The only things that it makes sense to compare the pointer equality of are mutable structures. But as I mentioned above, mutable structures, like IORefs, already instance Eq, which allows you to see if two IORefs are the same structure, which is exactly pointer equality.

提交回复
热议问题