-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
fromIntegral
with safer intCast
and Finite
constructor.
Justification: - Using `fromIntegral` can hide unsafe integral narrowing conversions. - Using `intCast` eliminates this class of error statically. When creating values of `Data.Interval.Extended`, we can use the `Finite` constructor instead of `fromIntegral`. The following expressions are equivalent: > Finite @int 1000 Finite 1000 > fromIntegral 1000 :: Extended Int Finite 1000 > Finite @int 1000 == fromIntegral 1000 True
- Loading branch information
1 parent
2f13c08
commit 4ee5534
Showing
2 changed files
with
24 additions
and
19 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