DeepSeq

Phil Trinder trinder@cee.hw.ac.uk
Mon, 22 Jul 2002 11:08:53 +0100 (GMT Daylight Time)


Dean, George,

>Would it be possible to bring the DeepSeq library into the libraries
>distributed with GHC?  (I think Dean Herington is responsible for it.)
>
>Of course it's easy enough to drop it into one's own program (I am just
>about to do this) but
>(1) It is fairly common to want to force deeper evaluation.
>(2) DeepSeq is simple enough to be dropped in the GHC distribution, without
>it causing much trouble or making it much bigger.
>(3) At the same time, it is not so simple that it can be reimplemented in a 
>couple of lines.

We use 'Evaluation Strategies' to control evaluation in parallel and 
distributed Haskells. The 'rnf' (reduce to normal form) strategy is equivalent 
to DeepSeq, and the Strategies library is already available in GHC (-syslib 
concurrent). More details in 

Trinder P.W. Hammond K. Loidl H-W. Peyton Jones S.L. Algorithm + Strategy = 
Parallelism. Journal of Functional Programming, 8(1) (January 1998) pp~23-60.

Phil

--------------------------------------------------
Phil Trinder
Department of Computing and Electrical Engineering
Heriot Watt University
Riccarton
Edinburgh, EH14 4AS

E-mail: trinder@cee.hw.ac.uk
Teleph: +44 (0)131 451 3435
Depart: +44 (0)131 451 3328
Fasmly: +44 (0)131 451 3327
Intrnt: http://www.cee.hw.ac.uk/~trinder