-- Solutions to exercises from the Central European Functional Programming summer school -- July 4th-16th 2005 -- Write a Hume program to select between one of two inputs taken from separate files -- depending on the value of a third input; -- HW-Hume solution -- Note -- a) the test generator box with no input; -- b) the fair matches in testgen and select; and -- c) the final case in select, which sends the box into a loop at end of input. -- Kevin Hammond, 5th July 2005 program data LR = Left | Right; box testgen in () out (control :: LR) fair * -> Left | * -> Right; box select in (cin1,cin2::char, control :: LR) out (cout::char) fair (c,*,Left) -> c | (*,c,Right) -> c | (*,*,_) -> *; stream stdout to "std_out"; stream sel1 from "selects1.txt"; stream sel2 from "selects2.txt"; wire select (sel1,sel2,testgen.control) (stdout); wire testgen () (select.control);