I want to write something like

type State a = IORef a

newState :: a -> State a
newState v = unsafePerformIO (newIORef v)


But I don't want the compileer to inline this nor to inline any application of this.

{#NOINLINE newState#}

But how can I stop this function to be inlined when applied for example :
....
let x = newState 0 in
{... code where x is used twice ...}

How to be sure that x isn't inlined and that all occurences of x are pointing to the same memory place ?

Best regards,
Nicolas Oury

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to