Proposal: generalize evaluate

David Feuer david.feuer at gmail.com
Wed Jan 7 15:48:13 UTC 2015


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" <michael at snoyman.com> wrote:

> -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 <david.feuer at gmail.com>
> 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 at haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20150107/3d38f838/attachment.html>


More information about the Libraries mailing list