3 ms·
I mean leaving IO to a program to which the (pure-only) Haskell code is linked, dispensing with monad-based separation. Frege seems to make this particularly ea
by asplake 11y ago
I mean leaving IO to a program to which the (pure-only) Haskell code is linked, dispensing with monad-based separation. Frege seems to make this particularly easy.
- the_af 11y agoThat's not that different to the standard separation of Haskell code between "inside IO" and "outside IO", is it? In this case, the calling Java code "lives" inside IO (as all Java programs do).
- voxfrege 11y agoSure, this would be possible. You can call "into" Frege code from any JVM language. OTOH, you can call any JVM code you could with Java (Frege is compiled to Java source code). The crucial point are the data that get exchanged between Frege and Java in either direction. While there are no problems with primitive types or Strings, standard JVM container classes like java.util.HashMap or java.util.ArrayList represent mutable data, and thus we can't use them with _pure_ Frege code. For that reason, we still need monads (in particuar, IO and ST) to deal with mutable data in Frege.