Simplify expt implementation
Describe the bug
The implementation of expt
at expt
number-dispatch is basically a huge cond
switch. Some of that is irreducible because we have to handle all the
different possible types for the two args. However, many of the cases
have identical implementations. We should merge them together because
it's really hard to reason about missing cases.
Or arrange the cases in a more logical order so that it's easier to follow and understand. Maybe arrange them with a single type for the first arg, and then the necessary cases for the different possible types of the second arg. That would seem to make it much easier to read reasonable about.
This complexity is the source of the error in #134 (closed).
Expected behavior
Code should be as clear and easy to follow as reasonably possible.
Desktop (please complete the following information):
- OS: All
- Version: snapshot-2021-07
Additional Context
This is fairly low priority, but it would be nice to clean this up, as mentioned in the comment.