[cvs-nhc98] Changed combinators for trusting in -hat.

User olaf olaf@sparud.net
Fri, 10 May 2002 13:19:37 +0200 (CEST)


olaf: Fri May 10 13:19:37 CEST 2002

Update of /usr/src/master/nhc/src/hat/lib
In directory hinken:/tmp/cvs-serv15568/src/hat/lib

Modified Files:
	Hat.hs 
Log Message:
Changed combinators for trusting in -hat.

The problem with the previous implementation was that the result of the reduction of a trusted function often contained many Hiddens, making the expression rather useless. E.g.: foldr (:) [] "Hi" = ({_} ({_} [])).

The cause was that wrapUForward only works if the trace is demanded before the wrapped expression is demanded. However, the uapn combinators required the function value first and sometimes later required the trace of the function.

Have changed uapn combinators to never demand the trace of the function. As a result, the result of the reduction of a trusted function is always shown as Hidden, if it is of functional type. However, if it is of an algebraic type, it is shown correctly. To achieve this, the cnn combinators for partially applied constructors had to be modified to record the complete constructor application in the trace, if called from untraced code.

Furthermore made the various application combinators less strict in Fun, to avoid potential blackholes. Thought this would avoid blackhole in Clausify program, but unfortunately it does not. Slightly improves performance though.