
Hi, NFData seems to be the "standard" deepseq-style class these days, but it lives in Control.Parallel.Strategies in the parallel package whereas it obviously has uses beyond this. Is there a case for moving it into its own package and module? I'd also like to add something like strictly :: (Monad m, NFData a) => m a -> m a strictly ma = do a <- ma rnf a `seq` return a The most important use for this would be to provide a standard way to do strict IO: strictly $ readFile "..." strictly $ hGetContents ... Thoughts? Cheers, Ganesh =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===============================================================================

Should NFData class and instances be in base? Data.Strict ? ganesh.sittampalam:
Hi,
NFData seems to be the "standard" deepseq-style class these days, but it lives in Control.Parallel.Strategies in the parallel package whereas it obviously has uses beyond this. Is there a case for moving it into its own package and module?
I'd also like to add something like
strictly :: (Monad m, NFData a) => m a -> m a strictly ma = do a <- ma rnf a `seq` return a
The most important use for this would be to provide a standard way to do strict IO:
strictly $ readFile "..." strictly $ hGetContents ...
Thoughts?
Cheers,
Ganesh
=============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===============================================================================
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

I think that would make most sense given how important deep strictness can be in certain situations. A separate, very small package would also be reasonable. Don Stewart wrote:
Should NFData class and instances be in base?
Data.Strict ?
ganesh.sittampalam:
Hi,
NFData seems to be the "standard" deepseq-style class these days, but it lives in Control.Parallel.Strategies in the parallel package whereas it obviously has uses beyond this. Is there a case for moving it into its own package and module?
I'd also like to add something like
strictly :: (Monad m, NFData a) => m a -> m a strictly ma = do a <- ma rnf a `seq` return a
The most important use for this would be to provide a standard way to do strict IO:
strictly $ readFile "..." strictly $ hGetContents ...
Thoughts?
Cheers,
Ganesh
======================================================================
========= Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
======================================================================
=========
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
=============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===============================================================================

For a package I released recently I had to define the following operators: -- |Very strict monadic bind (>>=|) :: (Monad m, NFData a) => m a -> (a -> m b) -> m b m >>=| f = m >>= f $| rnf (>>|) :: (Monad m, NFData a) => m a -> m b -> m b m1 >>| m2 = m1 >>=| const m2 It would be nice if I could drop the dependency on parallel.

Roel van Dijk wrote:
For a package I released recently I had to define the following operators:
-- |Very strict monadic bind (>>=|) :: (Monad m, NFData a) => m a -> (a -> m b) -> m b m >>=| f = m >>= f $| rnf
(>>|) :: (Monad m, NFData a) => m a -> m b -> m b m1 >>| m2 = m1 >>=| const m2
It would be nice if I could drop the dependency on parallel.
Now is not a good time to be changing the extralibs as the Platform is taking over from them. Once that's made its first release and settled down a bit I will propose this split properly. Ganesh =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===============================================================================
participants (4)
-
Bryan O'Sullivan
-
Don Stewart
-
Roel van Dijk
-
Sittampalam, Ganesh