Skip to content

Tag: haskell

How to read haskell.exe console output in Java?

I need to save Java output to test2.txt file, run through java compiled haskell hello.exe file, get data from tes2.txt, do something with it and then output result to console and read it with Java. Hello.exe Java When I run hello.exe by myself, it gives me the right result: 1 13 23. But when I run hello.exe w…

Java tagged union / sum types

Is there any way to define a sum type in Java? Java seems to naturally support product types directly, and I thought enums might allow it to support sum types, and inheritance looks like maybe it could do it, but there is at least one case I can’t resolve. To elaborate, a sum type is a type which can ha…