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

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



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

tp2 a b ::= Mk2 a b;

tp3 a b c ::= Mk3 a b c;

tp4 a b c d ::= Mk4 a b c d;

;;

unzip2 l
  = case l of
       Nil -> Mk2 Nil Nil;
       Cons pair pairs -> case pair of
          Mk2 x y      -> case unzip2 pairs of
          Mk2 xs ys    -> Mk2 (Cons x xs) (Cons y ys) end end 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.