Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/tests/nofib/real/anna/treeDepth.cor

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



expr t1 t2 t3 ::= Num t1 |
                  Lam t2 (expr t1 t2 t3) |
                  Var t3 |
                  App (expr t1 t2 t3) (expr t1 t2 t3); 

list a ::= Nil | Cons a (list a) ; ;;


walk e = case e of
   Num n -> n;
   Lam v e2 -> walk e2;
   Var v -> 0;
   App e1 e2 -> 
     (\x y -> case x>y of True -> x; False -> y end) (walk e1) (walk e2)
         end;


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.