From 0090813053c49a2c3f8c96793e3f110183635bc3 Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sat, 12 Jun 2021 17:15:24 +0200 Subject: [PATCH 1/3] make the types instances of Data, Generic and NFData --- css-easings.cabal | 1 + src/Css/Easing.hs | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/css-easings.cabal b/css-easings.cabal index 6c8c973..908ff07 100644 --- a/css-easings.cabal +++ b/css-easings.cabal @@ -26,6 +26,7 @@ library , aeson >=1.0 && <2 , blaze-markup >=0.8 && <0.9 , data-default >=0.7 && <0.8 + , deepseq >=1.4.3.0 , QuickCheck >=2.8 && <2.15 , scientific >=0.3 && <0.4 , shakespeare >=2.0 && <3.0 diff --git a/src/Css/Easing.hs b/src/Css/Easing.hs index ae280d9..1715ec8 100644 --- a/src/Css/Easing.hs +++ b/src/Css/Easing.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE CPP, OverloadedStrings, PatternSynonyms #-} +{-# LANGUAGE CPP, DeriveDataTypeable, DeriveGeneric, OverloadedStrings, PatternSynonyms #-} {-| Module : Css.Easing @@ -34,7 +34,10 @@ module Css.Easing ( , pattern EaseInBack, pattern EaseOutBack, pattern EaseInOutBack ) where +import Control.DeepSeq(NFData) + import Data.Aeson(Value(String), ToJSON(toJSON)) +import Data.Data(Data) import Data.Default(Default(def)) import Data.Scientific(Scientific, scientific) #if __GLASGOW_HASKELL__ < 803 @@ -42,6 +45,8 @@ import Data.Semigroup((<>)) #endif import Data.Text(Text, intercalate, pack) +import GHC.Generics(Generic) + import Text.Blaze(ToMarkup(toMarkup), text) import Text.Julius(ToJavascript(toJavascript)) @@ -66,7 +71,9 @@ data Easing | CubicBezier Scientific Scientific Scientific Scientific -- ^ An author defined cubic-Bezier curve, where the p1 and p3 values must -- be in the range of 0 to 1. - deriving (Eq, Ord, Show) + deriving (Data, Eq, Generic, Ord, Show) + +instance NFData Easing -- | Convert an 'Easing' to its css counterpart. The css aliases like -- @"steps-start"@ are /not/ checked. Therefore, only strings like "@steps(..)" @@ -96,7 +103,9 @@ data JumpTerm | JumpEnd -- ^ In css this is denoted as @jump-end@. Denotes a right-continuous function, so that the last jump happens when the animation ends. | JumpNone -- ^ In css this is denoted as @jump-none@. There is no jump on either end. Instead, holding at both the 0% mark and the 100% mark, each for 1/n of the duration. | JumpBoth -- ^ In css this is denoted as @jump-both@. Includes pauses at both the 0% and 100% marks, effectively adding a step during the transition time. - deriving (Bounded, Enum, Eq, Ord, Read, Show) + deriving (Bounded, Data, Enum, Eq, Generic, Ord, Read, Show) + +instance NFData JumpTerm -- | Convert a 'JumpTerm' to its css counterpart. So 'JumpStart' is for example -- converted to @"jump-start"@. From 2363a408a914849dd69c888a226a52a11c046c1f Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sun, 13 Jun 2021 19:12:00 +0200 Subject: [PATCH 2/3] update testing --- .github/workflows/build-ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index a88f58e..a476211 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -55,6 +55,9 @@ jobs: uses: hapytex/github-actions/actions/hlint@master linux5: + strategy: + matrix: + resolver: [lts-10, lts-11, lts-12, lts-13, lts-14, lts-15, lts-16, lts-17] name: Run the tests runs-on: ubuntu-latest steps: @@ -62,8 +65,10 @@ jobs: uses: hapytex/github-actions/actions/setup-haskell@master - name: checkout code uses: actions/checkout@v2.3.1 - - name: run the tests of the package - run: stack --no-terminal --skip-ghc-check test + - name: test the software with the given resolver + uses: hapytex/github-actions/actions/run-haskell-tests@master + with: + resolver: ${{ matrix.resolver }} linux6: name: Deploy documentation to GitHub pages From 6cca4e2765a918e5c442468a7ccef9d054348711 Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sun, 13 Jun 2021 19:12:24 +0200 Subject: [PATCH 3/3] bump to 0.2.2.0 --- css-easings.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css-easings.cabal b/css-easings.cabal index 908ff07..28e484f 100644 --- a/css-easings.cabal +++ b/css-easings.cabal @@ -1,5 +1,5 @@ name: css-easings -version: 0.2.1.0 +version: 0.2.2.0 synopsis: Defining and manipulating css easing strings. description: A package to define css easing strings. These can be used in Julius,