You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.
I can't compile the example code provided in the README.
I get the following compilation error:
[error] /MyApp.scala:10: overriding method run in trait SafeApp of type (args: List[String])scalaz.ioeffect.IO[scalaz.ioeffect.Void, MyApp.ExitStatus];
[error] method run has incompatible type
[error] def run(args: List[String]): IO[Void, ExitStatus] =
[error] ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 2 s, completed Feb 13, 2019 4:34:13 PM
And the following in IntelliJ:
Overriding type List[String] => IO[Void, MyApp.ExitStatus] does not conform to base type List[String] => IO[ioeffect.Void, SafeApp.this.ExitStatus]
Just to be clear, here is the example code from the README that I'm trying to run:
import scalaz.ioeffect.{IO, SafeApp}
import scalaz.ioeffect.console._
import java.io.IOException
object MyApp extends SafeApp {
def run(args: List[String]): IO[Void, ExitStatus] =
myAppLogic.attempt.map(_.fold(_ => 1, _ => 0)).map(ExitStatus.ExitNow(_))
def myAppLogic: IO[IOException, Unit] =
for {
_ <- putStrLn("Hello! What is your name?")
n <- getStrLn
_ <- putStrLn("Hello, " + n + ", good to meet you!")
} yield ()
}
I am using Scala 2.11.7 and Scalaz 7.2.27
The text was updated successfully, but these errors were encountered:
@ashkan-leo you have this error because your Void is not scalaz.ioeffect.Void but java.lang.Void.
If you import import scalaz.ioeffect.Void it will compile.
# for freeto subscribe to this conversation on GitHub.
Already have an account?
#.
I can't compile the example code provided in the README.
I get the following compilation error:
And the following in IntelliJ:
Just to be clear, here is the example code from the README that I'm trying to run:
I am using Scala 2.11.7 and Scalaz 7.2.27
The text was updated successfully, but these errors were encountered: