On Fri, Aug 07, 2009 at 08:56:39AM +1000, Peter Gammie wrote: > How so? Take this code: > > newtype BDD = BDD (ForeignPtr Int) > > exists :: Group BDD -> BDD -> BDD > exists group bdd = bdd `seq` unsafePerformIO $ > withGroup group $ \ gid -> > do bdd_assoc bdd_manager gid > withBDD bdd ({#call unsafe bdd_exists#} bdd_manager) >>= > addBDDfinalizer
Just a question, why not do > How so? Take this code: > > newtype BDD = BDD (ForeignPtr Int) > > exists :: Group BDD -> BDD -> BDD > exists group bdd = unsafePerformIO $ > bdd <- evaluate bdd > withGroup group $ \ gid -> > do bdd_assoc bdd_manager gid > withBDD bdd ({#call unsafe bdd_exists#} bdd_manager) >>= > addBDDfinalizer It seems that evaluate is exactly the thing to order evaluations in the IO monad. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/ _______________________________________________ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime