Skip to content

Commit

Permalink
update resolver, bump upper bounds, comment out OEIS support for now
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed Sep 26, 2023
1 parent 3ab4815 commit d17c02a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 38 deletions.
18 changes: 9 additions & 9 deletions disco.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ library
filepath,
directory,
mtl >=2.2 && <2.4,
megaparsec >= 6.1.1 && < 9.4,
megaparsec >= 6.1.1 && < 9.6,
parser-combinators >= 1.0.0 && < 1.4,
pretty >=1.1 && <1.2,
split >= 0.2 && < 0.3,
Expand All @@ -473,16 +473,16 @@ library
polysemy-zoo >= 0.7 && < 0.9,
lens >= 4.14 && < 5.3,
exact-combinatorics >= 0.2 && < 0.3,
arithmoi >= 0.10 && < 0.13,
arithmoi >= 0.10 && < 0.14,
integer-logarithms >= 1.0 && < 1.1,
simple-enumeration >= 0.2 && < 0.3,
haskeline >=0.8 && <0.9,
exceptions >= 0.10 && < 0.11,
QuickCheck >= 2.9 && < 2.15,
splitmix >= 0.1 && < 0.2,
fgl >= 5.5 && < 5.9,
optparse-applicative >= 0.12 && < 0.18,
oeis >= 0.3.10,
optparse-applicative >= 0.12 && < 0.19,
-- oeis2 < 1.1,
algebraic-graphs >= 0.5,
pretty-show >= 1.10

Expand All @@ -501,12 +501,12 @@ executable disco
haskeline >=0.8 && <0.9,
mtl >=2.2 && <2.4,
transformers >= 0.4 && < 0.7,
megaparsec >= 6.1.1 && < 9.4,
megaparsec >= 6.1.1 && < 9.6,
containers >= 0.5 && < 0.7,
unbound-generics >= 0.3 && < 0.4.3,
lens >= 4.14 && < 5.3,
optparse-applicative >= 0.12 && < 0.18,
oeis >= 0.3.10
optparse-applicative >= 0.12 && < 0.19
-- oeis2 < 1.1

default-language: Haskell2010

Expand All @@ -517,12 +517,12 @@ test-suite disco-tests
hs-source-dirs: test
ghc-options: -threaded
build-depends: base >= 4.7 && < 4.18,
tasty >= 0.10 && < 1.5,
tasty >= 0.10 && < 1.6,
tasty-golden >= 2.3 && < 2.4,
directory >= 1.2 && < 1.4,
filepath >= 1.4 && < 1.5,
process >= 1.4 && < 1.7,
bytestring >= 0.9 && < 0.12,
bytestring >= 0.9 && < 0.13,
disco
default-language: Haskell2010

Expand Down
49 changes: 25 additions & 24 deletions src/Disco/Interpret/CESK.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ import Math.Combinatorics.Exact.Binomial (choose)
import Math.Combinatorics.Exact.Factorial (factorial)
import Math.NumberTheory.Primes (factorise, unPrime)
import Math.NumberTheory.Primes.Testing (isPrime)
import Math.OEIS (
catalogNums,
extendSequence,
lookupSequence,
)

-- import Math.OEIS (
-- catalogNums,
-- extendSequence,
-- lookupSequence,
-- )

import Disco.Effects.Fresh
import Disco.Effects.Input
Expand Down Expand Up @@ -335,8 +336,8 @@ appConst k = \case
-- Sequences

OUntil -> arity2 $ \v1 -> out . ellipsis (Until v1)
OLookupSeq -> out . oeisLookup
OExtendSeq -> out . oeisExtend
-- OLookupSeq -> out . oeisLookup
-- OExtendSeq -> out . oeisExtend
--------------------------------------------------
-- Comparison

Expand Down Expand Up @@ -616,23 +617,23 @@ constdiff (x : xs)
-- OEIS
------------------------------------------------------------

-- | Looks up a sequence of integers in OEIS.
-- Returns 'left()' if the sequence is unknown in OEIS,
-- otherwise 'right "https://oeis.org/<oeis_sequence_id>"'
oeisLookup :: Value -> Value
oeisLookup (vlist vint -> ns) = maybe VNil parseResult (lookupSequence ns)
where
parseResult r = VInj R (listv charv ("https://oeis.org/" ++ seqNum r))
seqNum = getCatalogNum . catalogNums

getCatalogNum [] = error "No catalog info"
getCatalogNum (n : _) = n

-- | Extends a Disco integer list with data from a known OEIS
-- sequence. Returns a list of integers upon success, otherwise the
-- original list (unmodified).
oeisExtend :: Value -> Value
oeisExtend = listv intv . extendSequence . vlist vint
-- -- | Looks up a sequence of integers in OEIS.
-- -- Returns 'left()' if the sequence is unknown in OEIS,
-- -- otherwise 'right "https://oeis.org/<oeis_sequence_id>"'
-- oeisLookup :: Value -> Value
-- oeisLookup (vlist vint -> ns) = maybe VNil parseResult (lookupSequence ns)
-- where
-- parseResult r = VInj R (listv charv ("https://oeis.org/" ++ seqNum r))
-- seqNum = getCatalogNum . catalogNums

-- getCatalogNum [] = error "No catalog info"
-- getCatalogNum (n : _) = n

-- -- | Extends a Disco integer list with data from a known OEIS
-- -- sequence. Returns a list of integers upon success, otherwise the
-- -- original list (unmodified).
-- oeisExtend :: Value -> Value
-- oeisExtend = listv intv . extendSequence . vlist vint

------------------------------------------------------------
-- Normalizing bags/sets
Expand Down
10 changes: 5 additions & 5 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/

# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-20.18
# Use 20.18, not 20.19 since 20.19 has unbound-generics-0.4.3 which
# contains breaking changes (adding methods to Subst class)
resolver: lts-21.13

# Local packages, usually specified by relative directory name
packages:
- "."

# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
extra-deps:
- unbound-generics-0.4.2
# unbound-generics-0.4.3 contains breaking changes (adding methods to Subst class)
- simple-enumeration-0.2.1@sha256:8625b269c1650d3dd0e3887351c153049f4369853e0d525219e07480ea004b9f,1178
- oeis-0.3.10@sha256:d543b6693a842772c2b7daaeab65001e1e94a284f28e406a6adb268da989e8ad,1959
- HTTP-4000.3.16@sha256:6042643c15a0b43e522a6693f1e322f05000d519543a84149cb80aeffee34f71,5947
- polysemy-zoo-0.8.2.0
# - HTTP-4000.3.16@sha256:6042643c15a0b43e522a6693f1e322f05000d519543a84149cb80aeffee34f71,5947
# HTTP-4000.3 needed for oeis-0.3.10

# Override default flag values for local packages and extra-deps
Expand Down

0 comments on commit d17c02a

Please sign in to comment.