7 Examples

7.1 Self application

Fixpoint operator without rec

val fix = (fn x => x x)  
    (fn fix' => fn f => fn x => f((fix' fix') f) x);
 
 
val fac' = fn f => fn n => if (n=0) then 1 else n*f(n-1);
 
val fac = fix fac';
 


Andreas Simon and Gerhard Schneider
Generated on Thursday, November 26th 1998, 23:35:32