--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Thu Dec  9 09:17:43 1993
--* Received: from yktvmv.watson.ibm.com by leonardo.watson.ibm.com (AIX 3.2/UCB 5.64/4.03)
--*           id AA21715; Thu, 9 Dec 1993 09:17:43 -0500
--* X-External-Networks: yes
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 9847; Thu, 09 Dec 93 09:24:03 EST
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.SANTAS.NOTE.YKTVMV.4357.Dec.09.09:24:02.-0500>
--*           for asbugs@watson; Thu, 09 Dec 93 09:24:03 -0500
--* Received: from bernina.ethz.ch by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Thu, 09 Dec 93 09:24:02 EST
--* Received: from neptune by bernina.ethz.ch with SMTP inbound id <7124-0@bernina.ethz.ch>; Thu, 9 Dec 1993 15:23:38 +0100
--* From: Philip Santas <santas@inf.ethz.ch>
--* Received: from rutishauser.inf.ethz.ch (rutishauser-gw.inf.ethz.ch) by neptune id AA03719; Thu, 9 Dec 93 15:23:33 +0100
--* Date: Thu, 9 Dec 93 15:23:29 +0100
--* Message-Id: <9312091423.AA22403@rutishauser.inf.ethz.ch>
--* Received: from vinci.inf.ethz.ch.rutishauser by rutishauser.inf.ethz.ch id AA22403; Thu, 9 Dec 93 15:23:29 +0100
--* To: asbugs@watson.ibm.com
--* Subject: version of Y-comb which does not compile
--* Cc: bronstei, jenks@watson.ibm.com

--@ Fixed  by:  SSD   Mon Apr 18 15:08:46 1994 
--@ Tested by:  none 
--@ Summary:    Not a bug. The user intended to write a function application but instead wrote a pile. 


--However the following program  for Y-combinator (which
--is the same as the previous one) does not compile in any
--of the versions so far:

--------------------------------------------------------
#include "aslib.as"
SI ==> SingleInteger

Ycomb(S:Type, T:Type): with
     y: ((S->T) -> (S->T)) -> (S->T)
  == add
     Rep ==> % -> (S -> T)
     yt(x: %->(S->T)): % == per x
     ty(x: %): %->(S->T) == rep x
     y(f:(S->T)->(S->T)): S->T ==
         ((x:%):(S->T) +-> f ((a:S):T +-> (ty x).x.a))
         (yt ((x:%):(S->T) +-> f ((a:S):T +-> (ty x).x.a)))
         --f1(x:%):(S->T) == f ((a:S):T +-> (ty x).x.a)
         --f1(yt f1)

import from SI
import from Ycomb(SI,SI)

fact(recur:SI->SI)(n:SI):SI ==
      n=0 => 1
      n * recur(n-1)

print(y.fact.5)()
--------------------------------------------------------

 
