I am porting some Haskell code to Scala. In Haskell, I can use the error function. It seems at some point you can do it in Scala, but the ID environment shows me that it is deprecated now. Here is the code:
def prime (n : Int) : Boolean = () match {
case _ if n < 1 => error("not a positive integer")
case _ if n == 1 => false
case _ => ld (n) == n
}
What am I using instead of the error function in Scala?
source
share