-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
41 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
package doric | ||
package types | ||
|
||
trait NumericType[T] extends NumericIntegerType[T] with NumericDecimalsType[T] | ||
trait NumericType[T] { | ||
type Sum | ||
} | ||
|
||
object NumericType { | ||
def apply[T]: NumericType[T] = new NumericType[T] {} | ||
implicit val intNumeric: NumericType[Int] { | ||
type Sum = Long | ||
} = new NumericType[Int] { | ||
type Sum = Long | ||
} | ||
implicit val longNumeric: NumericType[Long] { | ||
type Sum = Long | ||
} = new NumericType[Long] { | ||
type Sum = Long | ||
} | ||
implicit val floatNumeric: NumericType[Float] { | ||
type Sum = Double | ||
} = new NumericType[Float] { | ||
type Sum = Double | ||
} | ||
implicit val doubleNumeric: NumericType[Double] { | ||
type Sum = Double | ||
} = new NumericType[Double] { | ||
type Sum = Double | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters