Skip to content

Commit

Permalink
Merge pull request #7 from 23prime/develop
Browse files Browse the repository at this point in the history
Release v1.0.8
  • Loading branch information
23prime authored Nov 7, 2024
2 parents bd198e1 + bb97a8d commit b23c658
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 57 deletions.
36 changes: 10 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,17 @@ jobs:
fail-fast: false
matrix:
plan:
- ghc: 8.0.2
resolver: lts-9.21
- ghc: 8.2.2
resolver: lts-11.22
- ghc: 8.4.4
resolver: lts-12.26
- ghc: 8.6.4
resolver: lts-13.19
- ghc: 8.6.5
resolver: lts-14.27
- ghc: 8.8.2
resolver: lts-15.3
- ghc: 8.8.4
resolver: lts-16.31
- ghc: 8.10.3
resolver: lts-17.2
- ghc: 8.10.7
resolver: lts-18.28
- ghc: 9.0.2
resolver: lts-19.0
- ghc: 9.4.8
resolver: lts-21.25
- ghc: 9.6.5
resolver: lts-22.25
- ghc: 9.8.2
resolver: nightly
- ghc: latest
resolver: lts
# Now, 'ghc: head' is unable
# See: https://github.com/haskell/actions/issues/93
# - ghc: head
- ghc: 9.2.2
resolver: nightly

runs-on: ubuntu-latest
continue-on-error: ${{ matrix.plan.allow-fail == true }}
Expand All @@ -67,24 +51,24 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup
uses: haskell/actions/setup@v1
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.plan.ghc }}
enable-stack: true
stack-version: 'latest'

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ matrix.plan.resolver }}

- name: Versions
run: |
ghc --version
ghc --version
stack --version
- name: Configure
Expand Down
30 changes: 14 additions & 16 deletions oeis2.cabal
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.34.4.
-- This file has been generated from package.yaml by hpack version 0.36.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: d12ab6c84c2584d3b6f205f5db01501658692c007dbabf678896c297b60ea3bc

name: oeis2
version: 1.0.7
version: 1.0.8
synopsis: Interface for Online Encyclopedia of Integer Sequences (OEIS).
description: Release notes are here https://github.com/23prime/oeis2/releases
category: Math
Expand Down Expand Up @@ -36,14 +34,14 @@ library
hs-source-dirs:
src
build-depends:
aeson >=1.1 && <2.1
, base >=4.7 && <5
aeson ==2.*
, base >=4.17 && <5
, containers >=0.5 && <0.7
, http-conduit >=2.2 && <2.4
, http-conduit >=2.2 && <3
, lens >=4.15 && <6
, lens-aeson >=1.0 && <2
, text ==1.2.*
, vector ==0.12.*
, lens-aeson >=1.2 && <2
, text ==2.*
, vector ==0.13.*
default-language: Haskell2010

test-suite oeis2-test
Expand All @@ -56,14 +54,14 @@ test-suite oeis2-test
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
QuickCheck
, aeson >=1.1 && <2.1
, base >=4.7 && <5
, aeson ==2.*
, base >=4.17 && <5
, containers >=0.5 && <0.7
, hspec
, http-conduit >=2.2 && <2.4
, http-conduit >=2.2 && <3
, lens >=4.15 && <6
, lens-aeson >=1.0 && <2
, lens-aeson >=1.2 && <2
, oeis2
, text ==1.2.*
, vector ==0.12.*
, text ==2.*
, vector ==0.13.*
default-language: Haskell2010
18 changes: 9 additions & 9 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: oeis2
version: 1.0.7
version: 1.0.8
github: "23prime/oeis2"
license: BSD3
author: "Taisuke Hikawa"
Expand All @@ -15,14 +15,14 @@ category: Math
description: Release notes are here https://github.com/23prime/oeis2/releases

dependencies:
- base >= 4.7 && < 5
- text >= 1.2 && < 1.3
- vector >= 0.12 && < 0.13
- aeson >= 1.1 && < 2.1
- containers >= 0.5 && < 0.7
- lens >= 4.15 && < 6
- lens-aeson >= 1.0 && < 2
- http-conduit >= 2.2 && < 2.4
- base >= 4.17 && < 5
- text >= 2 && < 3
- vector >= 0.13 && < 0.14
- aeson >= 2 && < 3
- containers >= 0.5 && < 0.7
- lens >= 4.15 && < 6
- lens-aeson >= 1.2 && < 2
- http-conduit >= 2.2 && < 3

library:
source-dirs: src
Expand Down
9 changes: 5 additions & 4 deletions src/Math/OEIS/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Math.OEIS.Internal where
import Control.Lens ((^?), (^?!))
import Control.Monad (when)
import Data.Aeson.Lens
import Data.Aeson.Key (fromText)
import Data.Aeson.Types
import Data.Char
import Data.Functor
Expand Down Expand Up @@ -121,7 +122,7 @@ getData result k

getIntData :: Value -> T.Text -> (T.Text, Maybe OEISData)
getIntData result k
= let d = result ^? key k ._Integer
= let d = result ^? key (fromText k) ._Integer
in case d of
Nothing -> (k, Nothing)
_ ->
Expand All @@ -133,7 +134,7 @@ getIntData result k

getTextData :: Value -> T.Text -> (T.Text, Maybe OEISData)
getTextData result k
= let d = result ^? key k ._String
= let d = result ^? key (fromText k) ._String
in case d of
Nothing -> (k, Nothing)
_ ->
Expand All @@ -147,11 +148,11 @@ getTextData result k

getTextsData :: Value -> T.Text -> (T.Text, Maybe OEISData)
getTextsData result k
= let ds = result ^? key k . _Array
= let ds = result ^? key (fromText k) . _Array
in case ds of
Nothing -> (k, Nothing)
_ ->
let ts = (\i -> result ^?! key k . nth i . _String) <$> [0..(len - 1)]
let ts = (\i -> result ^?! key (fromText k) . nth i . _String) <$> [0..(len - 1)]
len = fromJust $ V.length <$> ds
in case k of
"program" -> let prgs = parsePrograms emptyProgram [] ts
Expand Down
4 changes: 2 additions & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolver: lts-14.4
resolver: lts-22.25

packages:
- '.'

extra-deps: []
extra-deps: []

0 comments on commit b23c658

Please sign in to comment.