Scalaz and api improvements