akc / hops Goto Github PK
View Code? Open in Web Editor NEWHOPS - Handy Operations on Power Series
Home Page: http://akc.is/hops
License: BSD 3-Clause "New" or "Revised" License
HOPS - Handy Operations on Power Series
Home Page: http://akc.is/hops
License: BSD 3-Clause "New" or "Revised" License
I'm using Cabal 3.6.2.0, and the version of GHC is 8.10.7. When I try to build hops with cabal build
, it shows the following error:
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: hops-0.8.5 (user goal)
[__1] next goal: hops:setup.Cabal (dependency of hops)
[__1] rejecting: hops:setup.Cabal-3.2.1.0/installed-3.2.1.0 (conflict: hops =>
hops:setup.Cabal>=1.9 && <1.25)
[__1] skipping: hops:setup.Cabal-3.6.3.0, hops:setup.Cabal-3.6.2.0,
hops:setup.Cabal-3.6.1.0, hops:setup.Cabal-3.6.0.0, hops:setup.Cabal-3.4.1.0,
hops:setup.Cabal-3.4.0.0, hops:setup.Cabal-3.2.1.0, hops:setup.Cabal-3.2.0.0,
hops:setup.Cabal-3.0.2.0, hops:setup.Cabal-3.0.1.0, hops:setup.Cabal-3.0.0.0,
hops:setup.Cabal-2.4.1.0, hops:setup.Cabal-2.4.0.1, hops:setup.Cabal-2.4.0.0,
hops:setup.Cabal-2.2.0.1, hops:setup.Cabal-2.2.0.0, hops:setup.Cabal-2.0.1.1,
hops:setup.Cabal-2.0.1.0, hops:setup.Cabal-2.0.0.2 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=1.9 && <1.25' from 'hops')
[__1] rejecting: hops:setup.Cabal-1.24.2.0, hops:setup.Cabal-1.24.0.0,
hops:setup.Cabal-1.22.8.0, hops:setup.Cabal-1.22.7.0,
hops:setup.Cabal-1.22.6.0, hops:setup.Cabal-1.22.5.0,
hops:setup.Cabal-1.22.4.0, hops:setup.Cabal-1.22.3.0,
hops:setup.Cabal-1.22.2.0, hops:setup.Cabal-1.22.1.1,
hops:setup.Cabal-1.22.1.0, hops:setup.Cabal-1.22.0.0,
hops:setup.Cabal-1.20.0.4, hops:setup.Cabal-1.20.0.3,
hops:setup.Cabal-1.20.0.2, hops:setup.Cabal-1.20.0.1,
hops:setup.Cabal-1.20.0.0, hops:setup.Cabal-1.18.1.7,
hops:setup.Cabal-1.18.1.6, hops:setup.Cabal-1.18.1.5,
hops:setup.Cabal-1.18.1.4, hops:setup.Cabal-1.18.1.3,
hops:setup.Cabal-1.18.1.2, hops:setup.Cabal-1.18.1.1, hops:setup.Cabal-1.18.1,
hops:setup.Cabal-1.18.0, hops:setup.Cabal-1.16.0.3, hops:setup.Cabal-1.16.0.2,
hops:setup.Cabal-1.16.0.1, hops:setup.Cabal-1.16.0, hops:setup.Cabal-1.14.0,
hops:setup.Cabal-1.12.0, hops:setup.Cabal-1.10.2.0, hops:setup.Cabal-1.10.1.0,
hops:setup.Cabal-1.10.0.0, hops:setup.Cabal-1.8.0.6, hops:setup.Cabal-1.8.0.4,
hops:setup.Cabal-1.8.0.2, hops:setup.Cabal-1.6.0.3, hops:setup.Cabal-1.6.0.2,
hops:setup.Cabal-1.6.0.1, hops:setup.Cabal-1.4.0.2, hops:setup.Cabal-1.4.0.1,
hops:setup.Cabal-1.4.0.0, hops:setup.Cabal-1.2.4.0, hops:setup.Cabal-1.2.3.0,
hops:setup.Cabal-1.2.2.0, hops:setup.Cabal-1.2.1, hops:setup.Cabal-1.1.6,
hops:setup.Cabal-1.24.1.0 (constraint from minimum version of Cabal used by
Setup.hs requires >=3.2)
[__1] fail (backjumping, conflict set: hops, hops:setup.Cabal)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: hops:setup.Cabal, hops
Currently it only seems to be possible to specify functional equations via the command line. It would be nice if this was available through the library, without resorting to parsing a hops program.
Suppose I wish to find the number of partitions of 99 restricted to the summands 1, 5, 10, and 25. I naively try:
$ hops --prec=100 'PARTITION({1,5,10,25})'
{"hops":"PARTITION({1,5,10,25})","seq":[1,1,1,1]}
I first thought that this has to do with your use of Indet
as a tool for exploration. However, even if the {1,5,10,25} represents a truncation of a possibly infinite series, any further terms would involve a degree greater than 25. So it would seem that at a minimum the function h
in the where clause should use the maximum of cs instead of length cs
. Implementing this yields:
$ hops --prec=100 'PARTITION({1,5,10,25})'
{"hops":"PARTITION({1,5,10,25})","seq":[1,1,1,1,2,2,2,2,2,4,4,4,4,4,6,6,6,6,6,9,9,9,9,9,13]}
Better, but there should be some way to get this series to its full precision, so I can determine the coefficient of x^99. Also note what happens if I naively use square brackets:
$ hops --prec=100 'PARTITION([1,5,10,25])'
{"hops":"PARTITION({1,5,10,25})","seq":[]}
This occurs because the square bracket series contains zeros, which causes the empty series to result. We can avoid this by filtering out the zero coefficients. Implementing that yields:
$ hops --prec=100 'PARTITION([1,5,10,25])'
{"hops":"PARTITION({1,5,10,25})","seq":[1,1,1,1,2,2,2,2,2,4,4,4,4,4,6,6,6,6,6,9,9,9,9,9,13]}
Would it make sense to use the full precision if square brackets are used, but keep the current result if curly brackets are used? I think the documentation should be improved even if the current approach is retained.
Comment withdrawn
Currently all whitespace is being removed before parsing happens. This leads to weird behaviour such as
> hops 'f2 = x; f 2'
{"hops":"f2=x;f2","seq":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0]}
Obviously it should still be possible to have whitespace in an expression, but that needs to be handled in a different manner.
Currently the NixOS/Hydra build is failing because of this: http://hydra.nixos.org/job/nixpkgs/trunk/haskellPackages.hops.x86_64-linux
There currently exists an awkward and fuzzy distinction between functions and transforms. We should look at what the differences are between these two things, and either remove the distinction or make it more concrete, with appropriate refactoring in either case.
Currently hops uses fixed-point iteration to solve functional equations.We should look at alternative methods for finding fixed-points, such as Newton's method. It might be faster, and in any case will serve as a neat way to test and apply the library.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.