Porting Haskell programs based on logic and maths into Scala.