I'm trying to learn Scalaz with a toy project of mine, I used monads in Haskell and now I want to learn how to use them in Scala with Scalaz.
The big question is, how does one use the IO()
Monad in the Scala's main method?
In Haskell, the main function is of type IO()
and in Scala it is of type ()
.
The solution I found so far was to create another function foo
of type IO()
and in the main method call foo.unsafePerformIO()
. But this makes me cringe.
What could be a solution?