diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a6505e..3822d34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,28 +38,27 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - cabal: ["3.6"] + cabal: ["3.10"] # If you update this list of supported compiler versions, # make sure to update the `tested-with` section of `o-clock.cabal`. ghc: - - "8.6.5" - - "8.8.3" - - "8.10.4" - "9.0.2" - - "9.2.4" + - "9.2.8" + - "9.4.5" + - "9.6.2" exclude: - os: macOS-latest - ghc: 8.10.4 + ghc: 9.4.5 - os: macOS-latest - ghc: 8.8.3 + ghc: 9.2.8 - os: macOS-latest - ghc: 8.6.5 + ghc: 9.0.2 - os: windows-latest - ghc: 8.10.4 + ghc: 9.4.5 - os: windows-latest - ghc: 8.8.3 + ghc: 9.2.8 - os: windows-latest - ghc: 8.6.5 + ghc: 9.0.2 steps: - uses: actions/checkout@v3 @@ -90,15 +89,15 @@ jobs: - name: Haddock # Run haddock for all components run: | - cabal haddock --project-file=cabal.project.ci --haddock-all + cabal haddock --project-file=cabal.project.ci stack: name: stack / ghc ${{ matrix.ghc }} runs-on: ubuntu-latest strategy: matrix: - stack: ["2.9.1"] - ghc: ["9.0.2"] + stack: ["2.11.1"] + ghc: ["9.4.5"] steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index aae8469..d004e49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,13 +9,15 @@ Change log o'clock uses [PVP Versioning][1]. The change log is available [on GitHub][2]. -Unreleased +1.4.0 ===== * [#136](https://github.com/serokell/o-clock/pull/136) + Remove `toNum`. * [#139](https://github.com/serokell/o-clock/pull/139) + Add `Data` instance to `Time`. +* [#140](https://github.com/serokell/o-clock/pull/140) + + Increase some upper bounds. 1.3.0 ===== diff --git a/o-clock.cabal b/o-clock.cabal index b12ad4d..3017fba 100644 --- a/o-clock.cabal +++ b/o-clock.cabal @@ -4,7 +4,7 @@ cabal-version: 2.2 -- SPDX-License-Identifier: MPL-2.0 name: o-clock -version: 1.3.0 +version: 1.4.0 synopsis: Type-safe time library. description: See README.md for details. homepage: https://github.com/serokell/o-clock @@ -20,11 +20,10 @@ stability: stable extra-doc-files: CHANGELOG.md , README.md , README.lhs -tested-with: GHC == 8.6.5 - , GHC == 8.8.3 - , GHC == 8.10.4 - , GHC == 9.0.2 - , GHC == 9.2.4 +tested-with: GHC == 9.0.2 + , GHC == 9.2.8 + , GHC == 9.4.5 + , GHC == 9.6.2 source-repository head type: git @@ -50,7 +49,7 @@ library TypeApplications TypeFamilies if flag(aeson) - build-depends: aeson >= 1.2.4 && < 2.1 + build-depends: aeson >= 1.2.4 && < 2.3 , text cpp-options: -DHAS_aeson @@ -74,9 +73,9 @@ test-suite o-clock-test Test.Time.Units build-depends: o-clock - , hedgehog >= 0.6 && < 1.3 + , hedgehog >= 0.6 && < 1.4 , hspec-expectations ^>= 0.8 - , tasty >= 0.12 && < 1.5 + , tasty >= 0.12 && < 1.6 , tasty-hedgehog >= 0.1 && < 1.5.0 , tasty-hunit-compat ^>= 0.2 , type-spec >= 0.3.0.1 && < 0.5 @@ -95,7 +94,7 @@ test-suite o-clock-doctest main-is: Doctest.hs build-tool-depends: doctest:doctest - build-depends: doctest >= 0.16 && < 0.21 + build-depends: doctest >= 0.16 && < 0.23 , Glob >= 0.9 && < 0.11 ghc-options: -threaded -rtsopts -with-rtsopts=-N @@ -109,7 +108,7 @@ test-suite readme-test build-tool-depends: markdown-unlit:markdown-unlit build-depends: o-clock - , markdown-unlit ^>= 0.5 + , markdown-unlit >= 0.5 && < 0.7 ghc-options: -threaded -rtsopts -with-rtsopts=-N -pgmL markdown-unlit benchmark o-clock-benchmark diff --git a/src/Time/Rational.hs b/src/Time/Rational.hs index 4ad3ee4..c309c3f 100644 --- a/src/Time/Rational.hs +++ b/src/Time/Rational.hs @@ -1,18 +1,28 @@ --- SPDX-FileCopyrightText: 2019 Serokell +-- SPDX-FileCopyrightText: 2019-2023 Serokell -- -- SPDX-License-Identifier: MPL-2.0 {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoStarIsType #-} +{-# LANGUAGE PolyKinds #-} {-# LANGUAGE Rank2Types #-} -{-# LANGUAGE TypeInType #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +-- See https://github.com/ghc/ghc/commit/13d627bbd0bc3dd30d672de341aa7f471be0aa2c +-- Starting from 9.6, GHC doesn't print promotion ticks when they are not necessary. +-- Because of that we need to support too many cases in doctests. +-- Let's force redundant ticks for now and remove this flag later when we stop +-- supporting 9.0 at least. +#if ( __GLASGOW_HASKELL__ >= 906 ) +{-# OPTIONS_GHC -fprint-redundant-promotion-ticks #-} +#endif + -- | This module introduces 'Rat' kind and all necessary functional. module Time.Rational @@ -44,6 +54,11 @@ import GHC.TypeNats (Div, KnownNat, Mod, Nat, natVal, type (<=?)) import qualified GHC.TypeNats import Unsafe.Coerce (unsafeCoerce) +#if ( __GLASGOW_HASKELL__ >= 906 ) +-- $setup +-- >>> {-# OPTIONS_GHC -fprint-redundant-promotion-ticks #-} +#endif + -- | Data structure represents the rational number. -- Rational number can be represented as a pair of -- natural numbers @n@ and @m@ where @m@ is nor equal diff --git a/stack.yaml b/stack.yaml index 73cdd0d..7c0fa7c 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: 2019-2021 Serokell +# SPDX-FileCopyrightText: 2019-2023 Serokell # # SPDX-License-Identifier: MPL-2.0 -resolver: lts-19.27 +resolver: lts-21.12 extra-deps: - tiempo-0.0.1.1