-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
additionoh, so shiny!oh, so shiny!brrrsuch code, much wowsuch code, much wowmaybeto do, or not to do?to do, or not to do?subtractionhuh? where did it go?huh? where did it go?
Description
So I'm working on (#68) and (#69). The most straightforward solution results in protocol requirements with Optional<Fallible<T>> return types (#95). It works, and it seems viable, but I wouldn't call it elegant. I have some other ideas, however. One option is deriving safe operations from unsafe protocol requirements returning T. Another option, that may or may not be viable, is deriving division operations from a safe-but-unsigned requirement. It depends on how well the derived same-size-but-signed operations can be optimized. Imagine something like this:
protocol UnsignedInteger {
static func quotient(_ dividend: Natural<Self>, by divisor: Nonzero<Self>) -> Self
}Metadata
Metadata
Assignees
Labels
additionoh, so shiny!oh, so shiny!brrrsuch code, much wowsuch code, much wowmaybeto do, or not to do?to do, or not to do?subtractionhuh? where did it go?huh? where did it go?