Colin, Arjan, one further remark on
hyperseq x y = if x==x then y else error this is very unlikely
...
the result of an application 'normal x' is always true ...
I understand how this works,
but do we agree that it looks outright ugly?
We mean one thing (strictness)
but we write something quite
Johannes,
the result of an application 'normal x' is always true ...
I understand how this works,
but do we agree that it looks outright ugly?
I don't see why
f x | normal x = ... x ...
is any more ugly than
f x@(x : xs) = ... x ...
or (far worse)
f ~(x : xs) = ... x ...
or strictness annotations,
Hello Haskellers,
I supervise a student who uses Haskell for simulating neural nets. A lot of
computation goes on there and the program cannot handle as many iterations
as we would like. We have improved performance by a factor of more than ten
by putting strictness annotations in all data types.
1) Is there a more efficient definition of hyperseq that does not traverse
the data structure twice? The show function traverses the structure once
but I found it to be much slower.
I think DeepSeq is what you're looking for. I've had all these problems
and more and written down the advice
On 2004 June 17 Thursday 08:45, Arjan van IJzendoorn wrote:
function hyperseq and then applying it before the next iterations
begins:
hyperseq x y = if x==x then y else error this is very unlikely
This is very expensive
The concept of DeepSeq bothers me, because usually more limited use of