Strictness of addition functions.
Sean Seefried
Sean Seefried" <seefried@itee.uq.edu.au
Fri, 15 Mar 2002 13:37:20 +1000
Lately, I've been attempting to improve the performance of a highly
numerically intensive program.
Yet try as I might I cannot seem to define (nor find) an addition function
that is strict in both its arguments.
Using the advice found in the GHC Users Guide I have looked inside the .hi
file and discovered that the functions I define are indeed lazy in their
arguments.
Even when I try something like
data Pair = Pair !Int# !Int#
f (Pair x y) = x +# y
I still discovered to my dismay that the type of the first argument to f is
U(LL).
What can I do to force the arguments to be strict?
------------------------------------------------
Sean Seefried
School of ITEE
The University of Queensland
Ph: 3365 8301
Mob: 0416 338 636