In scala, union types are emulated with a private class / attribute with a number of subclasses containing individual cases. They can be defined directly in Haskell:
data Expr = Value Int | Add Expr Expr | Subtract Expr Expr
this differs from scala in that Value , Add and Subtract are constructors for the Expr type, whereas in Scala individual case classes also have their own type, which can be referenced directly, for example,
def printValue(v: Value): Unit = { println(vn) }
source share