-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
designDesign of APIs or of the language itselfDesign of APIs or of the language itselfdocsThis change adds or pertains to documentationThis change adds or pertains to documentationrationalsThe Rational type and values thereofThe Rational type and values thereof
Description
I want to implement //
for my own types. The return type would subtype Real
and it'd also overload numerator
and denominator
, but it wouldn't subtype Rational
. Would that be allowed?
The motivation is twofold:
- (Regular) continued fractions seem to be a good choice for encoding rational numbers. It'd be nice if such a type/package could overload
//
to return the same type, instead ofRational
. Rational
doesn't generally support type domain numbers, because it requires the numerator and denominator to have the same type. Thus a new, "type domain rational", type would be nice, and//
would ideally return type domain numbers given type domain numbers as input.
brainandforce
Metadata
Metadata
Assignees
Labels
designDesign of APIs or of the language itselfDesign of APIs or of the language itselfdocsThis change adds or pertains to documentationThis change adds or pertains to documentationrationalsThe Rational type and values thereofThe Rational type and values thereof