some exercises from FPinScala