Debugging partial functions by the rules