-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source file renaming, import ordering,
soundness
exports
- Loading branch information
1 parent
af02081
commit c2bd1f2
Showing
15 changed files
with
777 additions
and
555 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
Hypotenuse, version [unreleased]. Copyright 2024 Jon Pretty, Propensive OÜ. | ||
The primary distribution site is: https://propensive.com/ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | ||
file except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under the | ||
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
either express or implied. See the License for the specific language governing permissions | ||
and limitations under the License. | ||
*/ | ||
|
||
package hypotenuse | ||
|
||
import language.experimental.genericNumberLiterals | ||
import language.experimental.into | ||
|
||
trait CheckOverflow: | ||
type Wrap[ResultType] | ||
inline def addU64(left: U64, right: U64): Wrap[U64] | ||
inline def addI64(left: I64, right: I64): Wrap[I64] | ||
inline def addU32(left: U32, right: U32): Wrap[U32] | ||
inline def addI32(left: I32, right: I32): Wrap[I32] | ||
inline def addU16(left: U16, right: U16): Wrap[U16] | ||
inline def addI16(left: I16, right: I16): Wrap[I16] | ||
inline def addU8(left: U8, right: U8): Wrap[U8] | ||
inline def addI8(left: I8, right: I8): Wrap[I8] |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Hypotenuse, version [unreleased]. Copyright 2024 Jon Pretty, Propensive OÜ. | ||
The primary distribution site is: https://propensive.com/ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | ||
file except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under the | ||
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
either express or implied. See the License for the specific language governing permissions | ||
and limitations under the License. | ||
*/ | ||
|
||
package hypotenuse | ||
|
||
import language.experimental.captureChecking | ||
|
||
import scala.annotation.* | ||
|
||
trait CompareGreater[-LeftType, -RightType, +ResultType] extends NumericallyComparable: | ||
inline def greaterThan(inline left: LeftType, inline right: RightType): ResultType |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Hypotenuse, version [unreleased]. Copyright 2024 Jon Pretty, Propensive OÜ. | ||
The primary distribution site is: https://propensive.com/ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | ||
file except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under the | ||
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
either express or implied. See the License for the specific language governing permissions | ||
and limitations under the License. | ||
*/ | ||
|
||
package hypotenuse | ||
|
||
import language.experimental.captureChecking | ||
|
||
import scala.annotation.* | ||
|
||
trait CompareGreaterEqual[-LeftType, -RightType, +ResultType] extends NumericallyComparable: | ||
inline def greaterThanOrEqual(inline left: LeftType, inline right: RightType): ResultType |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Hypotenuse, version [unreleased]. Copyright 2024 Jon Pretty, Propensive OÜ. | ||
The primary distribution site is: https://propensive.com/ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | ||
file except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under the | ||
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
either express or implied. See the License for the specific language governing permissions | ||
and limitations under the License. | ||
*/ | ||
|
||
package hypotenuse | ||
|
||
import language.experimental.captureChecking | ||
|
||
import scala.annotation.* | ||
|
||
trait CompareLess[-LeftType, -RightType, +ResultType] extends NumericallyComparable: | ||
inline def lessThan(inline left: LeftType, inline right: RightType): ResultType |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Hypotenuse, version [unreleased]. Copyright 2024 Jon Pretty, Propensive OÜ. | ||
The primary distribution site is: https://propensive.com/ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | ||
file except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under the | ||
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
either express or implied. See the License for the specific language governing permissions | ||
and limitations under the License. | ||
*/ | ||
|
||
package hypotenuse | ||
|
||
import language.experimental.captureChecking | ||
|
||
import scala.annotation.* | ||
|
||
trait CompareLessEqual[-LeftType, -RightType, +ResultType] extends NumericallyComparable: | ||
inline def lessThanOrEqual(inline left: LeftType, inline right: RightType): ResultType |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Hypotenuse, version [unreleased]. Copyright 2024 Jon Pretty, Propensive OÜ. | ||
The primary distribution site is: https://propensive.com/ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | ||
file except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under the | ||
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
either express or implied. See the License for the specific language governing permissions | ||
and limitations under the License. | ||
*/ | ||
|
||
package hypotenuse | ||
|
||
import language.experimental.into | ||
|
||
trait DivisionByZero: | ||
type Wrap[ResultType] | ||
inline def divideU64(left: U64, right: U64): Wrap[U64] | ||
inline def divideI64(left: I64, right: I64): Wrap[I64] | ||
inline def divideU32(left: U32, right: U32): Wrap[U32] | ||
inline def divideI32(left: I32, right: I32): Wrap[I32] | ||
inline def divideU16(left: U16, right: U16): Wrap[U16] | ||
inline def divideI16(left: I16, right: I16): Wrap[I16] | ||
inline def divideU8(left: U8, right: U8): Wrap[U8] | ||
inline def divideI8(left: I8, right: I8): Wrap[I8] |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
Hypotenuse, version [unreleased]. Copyright 2024 Jon Pretty, Propensive OÜ. | ||
The primary distribution site is: https://propensive.com/ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | ||
file except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under the | ||
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
either express or implied. See the License for the specific language governing permissions | ||
and limitations under the License. | ||
*/ | ||
|
||
package hypotenuse | ||
|
||
import language.experimental.into | ||
|
||
import fulminate.* | ||
|
||
case class DivisionError() extends Error(msg"the result is unrepresentable") |
Oops, something went wrong.