Skip to content
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
65 changes: 65 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Continuous Integration

on:
push:

jobs:
continuous-integration:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ghc-version:
- "8.10.7"
- "9.0.2"
- "9.2.8"
- "9.4.8"
- "9.6.6"
- "9.8.2"
- "9.10.1"
flags:
- "" # base case
- "+binary"

steps:
- uses: actions/checkout@v4

- name: Install cabal/ghc
uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc-version }}
cabal-version: '3.10.3.0'

- name: Generate freeze file
run: |
cabal update
cabal configure --disable-optimization --flags="${{ matrix.flags }}" --enable-tests
cabal freeze

- name: Cache cabal work
uses: actions/cache@v4
with:
path: |
dist-newstyle
${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze', 'cabal.project.local') }}-cabal-install

- name: Build dependencies
run: |
cabal build --only-dependencies

- name: Build dimensional
run: |
cabal build

- name: Run tests
run: |
cabal test

# Note that we ignore the cabal freeze file (--ignore-project) because
# the `doctest` dependencies may clash with `dimensional` dependencies.
- name: Run doctests
run: |
cabal install doctest --ignore-project --disable-optimization
cabal repl dimensional --build-depends=QuickCheck --with-ghc=doctest
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ This library provides statically-checked dimensional arithmetic for physical qua
Data kinds and closed type families provide a flexible, safe, and discoverable implementation that leads to largely self-documenting
client code.

[![Build Status](https://api.travis-ci.com/bjornbm/dimensional.svg?branch=master)](https://app.travis-ci.com/github/bjornbm/dimensional)
[![Hackage Version](https://img.shields.io/hackage/v/dimensional.svg)](https://hackage.haskell.org/package/dimensional)
[![Stackage version](https://www.stackage.org/package/dimensional/badge/lts?label=Stackage)](https://www.stackage.org/package/dimensional)

Expand Down
21 changes: 7 additions & 14 deletions dimensional.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ bug-reports: https://github.com/bjornbm/dimensional/issues/
category: Math, Physics
synopsis: Statically checked physical dimensions
cabal-version: >= 1.10
tested-with: GHC == 8.0.1, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.1, GHC == 8.8.3, GHC == 8.10.4
tested-with: GHC == 8.10.7,
GHC == 9.0.2,
GHC == 9.2.8,
GHC == 9.4.8,
GHC == 9.6.6,
GHC == 9.8.2,
GHC == 9.10.1
build-type: Simple

description:
Expand Down Expand Up @@ -99,19 +105,6 @@ test-suite tests
base
build-tool-depends: hspec-discover:hspec-discover == 2.*

test-suite doctests
type: exitcode-stdio-1.0
ghc-options: -threaded
main-is: DocTests.hs
hs-source-dirs: tests
default-language: Haskell2010
build-depends: dimensional,
doctest,
Glob,
QuickCheck,
template-haskell,
base

benchmark simple
type: exitcode-stdio-1.0
hs-source-dirs: benchmarks
Expand Down
2 changes: 2 additions & 0 deletions src/Numeric/Units/Dimensional.hs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ import qualified Numeric.Units.Dimensional.Variants as V
-- $setup
-- >>> :set -XFlexibleInstances
-- >>> :set -XNoImplicitPrelude
-- >>> :set -fno-warn-orphans
-- >>> :set -fno-warn-type-defaults
-- >>> import Test.QuickCheck.Arbitrary
-- >>> import Numeric.Units.Dimensional.Prelude
-- >>> import Numeric.Units.Dimensional.Float
Expand Down
1 change: 1 addition & 0 deletions src/Numeric/Units/Dimensional/Dimensions/TermLevel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import Prelude (id, all, fst, snd, fmap, otherwise, divMod, ($), (+), (-), (.),
import qualified Prelude as P

-- $setup
-- >>> :set -fno-warn-orphans
-- >>> import Prelude (negate)
-- >>> import Control.Applicative
-- >>> import Test.QuickCheck.Arbitrary
Expand Down
1 change: 1 addition & 0 deletions src/Numeric/Units/Dimensional/Float.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import Numeric.Units.Dimensional.Prelude hiding (RealFloat(..))
import Numeric.Units.Dimensional.Coercion

-- $setup
-- >>> :set -fno-warn-type-defaults
-- >>> :set -XExtendedDefaultRules
-- >>> :set -XNegativeLiterals

Expand Down
1 change: 1 addition & 0 deletions src/Numeric/Units/Dimensional/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import qualified Prelude as P

-- $setup
-- >>> :set -XNoImplicitPrelude
-- >>> :set -fno-warn-type-defaults
-- >>> import Numeric.Units.Dimensional.Prelude

-- | A unit of measurement.
Expand Down
1 change: 1 addition & 0 deletions src/Numeric/Units/Dimensional/NonSI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import Numeric.Units.Dimensional.UnitNames.Internal (ucumMetric, ucum, dimension
import qualified Prelude

-- $setup
-- >>> :set -fno-warn-type-defaults
-- >>> import Data.ExactPi
-- >>> import Data.Function (on)
-- >>> import Numeric.Units.Dimensional.Coercion
Expand Down
1 change: 1 addition & 0 deletions src/Numeric/Units/Dimensional/Quantities.hs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ to the definitions of 'DArea' and 'DVolume'.
-}

-- $setup
-- >>> :set -fno-warn-type-defaults
-- >>> import Numeric.Units.Dimensional.Prelude

-- | Constructs a unit of area from a unit of length, taking the area of a square whose sides are that length.
Expand Down
17 changes: 0 additions & 17 deletions tests/DocTests.hs

This file was deleted.