
Hi! I want to analyse the laziness of a data structure. To check how many nodes are constructed I use a global counter. counter :: IORef Int counter = unsafePerformIO (newIORef 0) This counter is increased every time the constructor is called by redefining the constructor OBDD as follows. oBDD low var high = seq (unsafePerformIO (modifyIORef counter (+1))) (OBDD low var high) This works fine. When I compile with optimisations the counter is always set to one no matter how many nodes are constructed. I thought this would be caused by inlining. Therefore I have added two NOINLINE pragmata. {-# NOINLINE counter #-} {-# NOINLINE oBDD #-} Although the counter doesn't work. Is there another optimisation that can cause harm? Is there something wrong with the pragmata? best regards, Jan