
21 Aug
2014
21 Aug
'14
10:34 a.m.
On Wed, Aug 20, 2014 at 06:19:26PM -0700, John Meacham wrote:
It is possible to do safely without breaking things when done in the IO Monad,
import System.Mem.StableName sameThing :: a -> a -> IO a sameThing x y = liftM2 (==) (makeStableName x) (makeStableName y)
I don't think this has the behaviour that Johan (the OP) wants. import System.Mem.StableName import Control.Monad sameThing :: a -> a -> IO Bool sameThing x y = liftM2 (==) (makeStableName x) (makeStableName y) main = do let x = 1 y = x print =<< sameThing x y print =<< sameThing x x GHCi> main False True I suspect Johan wants "True; True". Tom