Discussion: Can we make evaluate easier to find?

David Feuer david.feuer at gmail.com
Thu Jan 8 17:15:06 UTC 2015


deepseq is somewhat orthogonal:

shallow: v $! return v
deep: v $!! return v
shallow: evaluate v >>= return
deep: evaluate (force v) >>= return

On Thu, Jan 8, 2015 at 12:11 PM, John Lato <jwlato at gmail.com> wrote:
> AKAIK neither one is necessarily safe. You need something like deepseq to
> fully evaluate the lazy structure.
>
> If you are sure that evaluation to WHNF is sufficient for performing all
> lazy IO, then I think either evaluate or ($!) will work.
>
> evaluate is probably to be preferred if IO is available, similar to throw vs
> throwIO.  However I think idioms with seq and ($!) are so common that they
> need to be supported too. After all, you may have just a 'Monad m' context.
>
> John


More information about the Libraries mailing list