Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/tests/nofib/real/reptile/Interstate.hs

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


-- LML original: Sandra Foubister, 1990
-- Haskell translation: Colin Runciman, May 1991

module Interstate(inter) where

inter :: (a->[b]) -> (a->c->Bool) -> (a->c->([b],a,c)) -> (a->c->[b])
inter prompt endp transact =
	interprog
	where
        interprog state inpt =
	  prompt state ++
          if endp state inpt then []
          else response ++ interprog newstate restofinput
	       where
               (response,newstate,restofinput) = transact state inpt




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.