Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RealFrac Seconds instance #89

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
wasi:
runs-on: ubuntu-latest
env:
GHC_WASM_META_REV: 5a5c10c3b7e2f9f55bb2f40601cb20c9eb599bb5
GHC_WASM_META_REV: 895f7067e1d4c918a45559da9d2d6a403a690703
FLAVOUR: '9.6'
steps:
- name: Setup WASI GHC
Expand Down
2 changes: 1 addition & 1 deletion System/Clock/Seconds.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ instance Fractional Seconds where

instance RealFrac Seconds where
properFraction (Seconds (TimeSpec s ns))
| s >= 0 = (fromIntegral s, Seconds $ TimeSpec 0 ns)
| s >= 0 || ns == 0 = (fromIntegral s, Seconds $ TimeSpec 0 ns)
| otherwise = (fromIntegral (s+1), Seconds $ TimeSpec (-1) ns)

-- | The 'getTime' function shall return the current value for the
Expand Down
7 changes: 6 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ packages: .
-- Andreas Abel, 2022-02-07, issue #72: Fix cyclic dependencies.
-- The default would be tasty +clock, but this creates a dependency cycle.
constraints:
tasty -clock
tasty -clock

-- otherwise, we get CI failures
if impl(ghc ==8.2.*)
package text
flags: -simdutf