import me.elrod.pureio.*;
import java.util.function.Function;

public class ConsoleFileCoproductExample {
    public static void main(String[] args) {
        ConsoleFileFree<LinkedList<String>> first =
            ConsoleFileLib.putStrLn("What is your name?").liftF()
            .$ (x     -> ConsoleFileLib.readLine().liftF()
            .$ (name  -> ConsoleFileLib.putStrLn("Hi there, " + name + "! Give me a file to read:").liftF()
            .$ (u1    -> ConsoleFileLib.readLine().liftF()
            .$ (fname -> ConsoleFileLib.readLines(fname).liftF()))));

        // This doesn't have to be separate, but why not?
        ConsoleFileFree<LinkedList<Unit>> second =
            first
            .$ (x -> ConsoleFileFree.mapM(
                    y -> ConsoleFileLib.putStrLn(y).liftF(),
                    x));

        UnsafePerformIO.unsafePerformConsoleFileIO(second);
    }
}

@@ -183,22 +183,22 @@
 ist%3C
-String%3E%3E first
+Unit%3E%3E program
  =%0A 
@@ -556,18 +556,16 @@
 tF()))))
-;%0A
 %0A       
@@ -569,144 +569,21 @@
     
-// This doesn't have to be separate, but why not?%0A        ConsoleFileFree%3CLinkedList%3CUnit%3E%3E second =%0A            first%0A            .$ (x
+    .$ (lines
  -%3E 
@@ -603,37 +603,16 @@
 ee.mapM(
-%0A                    
 y -%3E Con
@@ -647,30 +647,14 @@
 F(),
-%0A                    x
+ lines
 ));%0A
@@ -709,14 +709,15 @@
 eIO(
-second
+program
 );%0A 

combine the two programs