Proposal: generalize evaluate

Apparently, there was an issue with my last messages about this for some people, so here's the idea again: We could generalize Control.Exception.evaluate to evaluate :: PrimMonad m => a -> m a evaluate a = primitive (\s -> seq# a s) and then export it from Control.Monad.Primitive as well, which seems to me a much more natural place for it. The only challenge is that the PrimMonad class would need to be moved to base.

-1 from me, adding things to base like this is a step backwards IMO. I
don't see a problem with adding a generalize evaluate to primitive as well,
however. We could also consider adding an evaluateST function somewhere in
base, if that was desired (I've personally never needed it, but I could
imagine it being useful).
On Wed Jan 07 2015 at 5:41:06 PM David Feuer
Apparently, there was an issue with my last messages about this for some people, so here's the idea again:
We could generalize Control.Exception.evaluate to
evaluate :: PrimMonad m => a -> m a evaluate a = primitive (\s -> seq# a s)
and then export it from Control.Monad.Primitive as well, which seems to me a much more natural place for it. The only challenge is that the PrimMonad class would need to be moved to base. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

FYI, my original goal was not actually generalizing it, but rather finding
it a more obvious home than Control.Exception. Control.Monad.Primitive was
the best match I could find, since there is no Control.Monad.IO to match
Control.Monad.ST.
On Jan 7, 2015 10:44 AM, "Michael Snoyman"
-1 from me, adding things to base like this is a step backwards IMO. I don't see a problem with adding a generalize evaluate to primitive as well, however. We could also consider adding an evaluateST function somewhere in base, if that was desired (I've personally never needed it, but I could imagine it being useful).
On Wed Jan 07 2015 at 5:41:06 PM David Feuer
wrote: Apparently, there was an issue with my last messages about this for some people, so here's the idea again:
We could generalize Control.Exception.evaluate to
evaluate :: PrimMonad m => a -> m a evaluate a = primitive (\s -> seq# a s)
and then export it from Control.Monad.Primitive as well, which seems to me a much more natural place for it. The only challenge is that the PrimMonad class would need to be moved to base. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
participants (2)
-
David Feuer
-
Michael Snoyman