(Sorry for the double mail) ...so there is no way to do that inside the function passed to modifySTRef? In other words, there is no way to ensure *inside* a function that its result will be evaluated strictly?
2011/11/18 Daniel Fischer <[email protected]> > On Friday 18 November 2011, 11:18:33, Yves Parès wrote: > > Instead of rewriting modifySTRef, why not just do : > > > > modifySTRef counter (\x -> let y = x+1 in y `seq` y) > > > > Is there a problem with that? > > Yes, y `seq` y is precisely the same as y. > > a `seq` b means whenever evaluation of b is demanded, also evaluate a (to > WHNF). > So y `seq` y ~> whenever evaluation of y is demanded, also evaluate y. >
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
