Port of Haskell's free package to Scala