Replace AsError with a better behaved type class
More Eitan golf