Skip to content

Commit

Permalink
Cleanup and CI update (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
arybczak authored Jun 20, 2023
1 parent 7115c53 commit 09b4bfa
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 34 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'monad-time.cabal'
# haskell-ci 'github' '--config=cabal.haskell-ci' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.15.20230321
# version: 0.16.3
#
# REGENDATA ("0.15.20230321",["github","monad-time.cabal"])
# REGENDATA ("0.16.3",["github","--config=cabal.haskell-ci","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -32,14 +32,19 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.4.4
- compiler: ghc-9.6.2
compilerKind: ghc
compilerVersion: 9.4.4
compilerVersion: 9.6.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.3
- compiler: ghc-9.4.5
compilerKind: ghc
compilerVersion: 9.2.3
compilerVersion: 9.4.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
compilerKind: ghc
compilerVersion: 9.2.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.0.2
Expand Down Expand Up @@ -152,26 +157,26 @@ jobs:
- name: cache (tools)
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-ea326311
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-ee7e0b4e
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: install doctest
run: |
$CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20'
doctest --version
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20' ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then doctest --version ; fi
- name: save cache (tools)
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-ea326311
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-ee7e0b4e
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -230,8 +235,8 @@ jobs:
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: doctest
run: |
cd ${PKGDIR_monad_time} || false
doctest -XHaskell2010 src
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then cd ${PKGDIR_monad_time} || false ; fi
if [ $((HCNUMVER < 90600)) -ne 0 ] ; then doctest -XHaskell2010 -XFlexibleContexts -XFlexibleInstances src ; fi
- name: cabal check
run: |
cd ${PKGDIR_monad_time} || false
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# monad-time [![Hackage version](https://img.shields.io/hackage/v/monad-time.svg?label=Hackage)](https://hackage.haskell.org/package/monad-time) [![Build Status](https://secure.travis-ci.org/scrive/monad-time.svg?branch=master)](http://travis-ci.org/scrive/monad-time)
# monad-time

`MonadTime` type class for monads which make it possible to measure time.
[![Build Status](https://github.com/scrive/monad-time/workflows/Haskell-CI/badge.svg?branch=master)](https://github.com/scrive/monad-time/actions?query=branch%3Amaster)
[![Hackage](https://img.shields.io/hackage/v/monad-time.svg)](https://hackage.haskell.org/package/monad-time)
[![Dependencies](https://img.shields.io/hackage-deps/v/monad-time.svg)](https://packdeps.haskellers.com/[email protected])
[![Stackage LTS](https://www.stackage.org/package/monad-time/badge/lts)](https://www.stackage.org/lts/package/monad-time)
[![Stackage Nightly](https://www.stackage.org/package/monad-time/badge/nightly)](https://www.stackage.org/nightly/package/monad-time)

`MonadTime` type class for monads which make it possible to measure time.
2 changes: 0 additions & 2 deletions Setup.hs

This file was deleted.

2 changes: 1 addition & 1 deletion cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
branches: master
doctest: True
doctest: <9.5
tests: True
1 change: 1 addition & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages: .
11 changes: 6 additions & 5 deletions monad-time.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ homepage: https://github.com/scrive/monad-time
license: BSD3
license-file: LICENSE
author: Andrzej Rybczak
maintainer: Andrzej Rybczak <[email protected]>,
Jonathan Jouty <[email protected]>,
Mikhail Glushenkov <[email protected]>
maintainer: Andrzej Rybczak <[email protected]>
copyright: Scrive AB
category: Control
build-type: Simple
cabal-version: >=1.10
extra-source-files: README.md CHANGELOG.md
tested-with: GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.3, GHC == 9.4.4
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2

source-repository head
type: git
Expand All @@ -35,7 +33,10 @@ library

default-language: Haskell2010

test-suite monad-time-test
default-extensions: FlexibleContexts
, FlexibleInstances

test-suite test
type: exitcode-stdio-1.0
main-is: Main.hs
hs-source-dirs: test
Expand Down
15 changes: 6 additions & 9 deletions src/Control/Monad/Time.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{-# LANGUAGE CPP, FlexibleContexts, FlexibleInstances, UndecidableInstances #-}

#if __GLASGOW_HASKELL__ < 710
{-# LANGUAGE OverlappingInstances #-}
#endif

module Control.Monad.Time (MonadTime(..)) where
{-# LANGUAGE UndecidableInstances #-}
module Control.Monad.Time
( MonadTime(..)
) where

import Control.Monad.Trans
import Data.Time
Expand All @@ -21,8 +18,8 @@ instance MonadTime IO where
monotonicTime = getMonotonicTime

-- | Generic, overlapping instance.
instance {-# OVERLAPPABLE #-} (
MonadTime m
instance {-# OVERLAPPABLE #-}
( MonadTime m
, MonadTrans t
, Monad (t m)
) => MonadTime (t m) where
Expand Down

0 comments on commit 09b4bfa

Please sign in to comment.