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

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



{----------------------------------------------------------------}
{--- My attempt at a translation of the Haskell 1.1           ---}
{--- list prelude, "module PreludeList".                      ---}
{----------------------------------------------------------------}

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

;;

{--------------------------------------------------------}
{--- Preliminaries                                    ---}
{--------------------------------------------------------}


dot f g x
= f (g x);


any p l
= case l of
    Nil -> False;
    Cons x xs -> p x | any p xs
  end; 

elem l
= dot any (\a b -> a == b) l;


{----------------------------------------------------------------}
{--- end                                      preludeList.cor ---}
{----------------------------------------------------------------}

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.