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
51 changes: 45 additions & 6 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20250506
# version: 0.19.20250821
#
# REGENDATA ("0.19.20250506",["github","microaeson.cabal"])
# REGENDATA ("0.19.20250821",["github","microaeson.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -32,6 +32,11 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.14.0.20250819
compilerKind: ghc
compilerVersion: 9.14.0.20250819
setup-method: ghcup-prerelease
allow-failure: false
- compiler: ghc-9.12.2
compilerKind: ghc
compilerVersion: 9.12.2
Expand Down Expand Up @@ -110,8 +115,8 @@ jobs:
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
Expand All @@ -126,6 +131,21 @@ jobs:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Install GHC (GHCup prerelease)
if: matrix.setup-method == 'ghcup-prerelease'
run: |
"$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
Expand All @@ -136,7 +156,7 @@ jobs:
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
Expand Down Expand Up @@ -164,6 +184,18 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
if $HEADHACKAGE; then
cat >> $CABAL_CONFIG <<EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
key-threshold: 3
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF
fi
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
Expand Down Expand Up @@ -212,10 +244,17 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_microaeson}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package microaeson" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package microaeson" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package microaeson" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
cat >> cabal.project <<EOF
allow-newer: containers
EOF
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(microaeson)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
Expand Down
39 changes: 21 additions & 18 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,47 @@ jobs:
matrix:
os: [ubuntu-latest]
plan:
- ghc: '9.10.1'
resolver: 'nightly-2025-03-11'
- ghc: '9.12.2'
resolver: 'nightly-2025-09-01'
- ghc: '9.10.2'
resolver: 'lts-24.8'
- ghc: '9.8.4'
resolver: 'lts-23.14'
- ghc: '9.6.6'
resolver: 'lts-22.43'
resolver: 'lts-23.28'
- ghc: '9.6.7'
resolver: 'lts-22.44'
- ghc: '9.4.8'
resolver: 'lts-21.25'
- ghc: '9.2.8'
resolver: 'lts-20.26'
- ghc: '9.0.2'
resolver: 'lts-19.33'
- ghc: '8.10.7'
resolver: 'lts-18.28'
- ghc: '8.8.4'
resolver: 'lts-16.31'
- ghc: '8.6.5'
resolver: 'lts-14.27'
- ghc: '8.4.4'
resolver: 'lts-12.26'
# Dropping support for aeson<2
# - ghc: '8.10.7'
# resolver: 'lts-18.28'
# - ghc: '8.8.4'
# resolver: 'lts-16.31'
# - ghc: '8.6.5'
# resolver: 'lts-14.27'
# - ghc: '8.4.4'
# resolver: 'lts-12.26'

include:
- os: windows-latest
plan:
ghc: '9.10.1'
resolver: 'nightly-2025-03-11'
ghc: '9.12.2'
resolver: 'nightly-2025-09-01'

- os: macos-latest
plan:
ghc: '9.10.1'
resolver: 'nightly-2025-03-11'
ghc: '9.12.2'
resolver: 'nightly-2025-09-01'

runs-on: ${{ matrix.os }}
env:
STACK: stack --system-ghc --no-terminal --resolver ${{ matrix.plan.resolver }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: haskell-actions/setup@latest
id: setup
Expand Down
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### 0.1.0.3

_Andreas Abel, 2025-09-01_

- Drop support for `aeson-1.*`.
- Remove unused dependencies.
- Tested with GHC 8.0 - 9.14 alpha1.


### 0.1.0.2

_Andreas Abel, 2024-06-25_
Expand All @@ -10,5 +19,5 @@ _Andreas Abel, 2024-06-25_

_Andreas Abel, 2022-05-26_

- Allow `base >= 4.17`
- Tested with GHC 7.10 - 9.4
- Allow `base >= 4.17`.
- Tested with GHC 7.10 - 9.4.
13 changes: 4 additions & 9 deletions microaeson.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cabal-version: 2.0
name: microaeson
version: 0.1.0.2
x-revision: 2
version: 0.1.0.3

synopsis: A tiny JSON library with light dependency footprint
license: GPL-3
Expand All @@ -21,6 +20,7 @@ The API is designed in such a way to allow to easily convert client code written
}

tested-with:
GHC == 9.14.1
GHC == 9.12.2
GHC == 9.10.2
GHC == 9.8.4
Expand All @@ -35,7 +35,7 @@ tested-with:
GHC == 8.2.2
GHC == 8.0.2

extra-source-files:
extra-doc-files:
CHANGELOG.md
README.md

Expand Down Expand Up @@ -64,7 +64,6 @@ library
, bytestring >= 0.10.8.0 && < 0.13
, containers >= 0.5.7.1 && < 1
, deepseq >= 1.4.2.0 && < 1.6
, fail ^>= 4.9.0.0
, text >= 1.2.2.2 && < 1.3 || >= 2.0 && < 3

build-tool-depends: alex:alex >= 3.2.0
Expand All @@ -91,17 +90,13 @@ test-suite microaeson

-- constraints inherited via lib:microaeson component
build-depends: base
, bytestring
, containers
, text

-- dependencies requiring constraints
build-depends: aeson >= 1.3.1.0 && < 2.3
, QuickCheck >= 2.11.3 && < 3
build-depends: aeson >= 2.0.3.0 && < 2.3
, quickcheck-instances ^>= 0.3.16
, tasty >= 1.0.1.1 && < 1.6
, tasty-quickcheck >= 0.10 && < 1
, unordered-containers ^>= 0.2.8.0
, vector ^>= 0.12.0.1
|| ^>= 0.13.0.0

Expand Down
15 changes: 1 addition & 14 deletions src-tests/tests.hs
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{-# LANGUAGE CPP #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module Main where

#if !MIN_VERSION_aeson(2,0,0)
import qualified Data.HashMap.Strict as KeyMap
import Data.Text (Text)
#else
import qualified Data.Aeson.KeyMap as KeyMap
import Data.Aeson.Key (fromText, toText)
#endif
import qualified Data.Map.Strict as Map
import qualified Data.Vector as V

Expand Down Expand Up @@ -78,9 +71,3 @@ fromAeson j = case j of
REF.Number s -> IUT.Number (realToFrac s)
REF.Array v -> IUT.Array (map fromAeson (V.toList v))
REF.Object m -> IUT.object [ (toText k, fromAeson v) | (k,v) <- KeyMap.toList m ]

#if !MIN_VERSION_aeson(2,0,0)
fromText, toText :: Text -> Text
fromText = id
toText = id
#endif
3 changes: 1 addition & 2 deletions src/Data/Aeson/Micro.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ import Data.Int
import Data.List (intersperse)
import Data.Monoid
import Data.String
import Data.Typeable (Typeable)
import Data.Word
import GHC.Generics (Generic)

Expand All @@ -104,7 +103,7 @@ data Value = Object !Object
| Number !Double
| Bool !Bool
| Null
deriving (Eq, Read, Show, Generic, Data, Typeable)
deriving (Eq, Read, Show, Generic, Data)

instance NFData Value

Expand Down
Loading