akc / hops

HOPS - Handy Operations on Power Series
http://akc.is/hops
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

Functional equations via the library #14

Open SuprDewd opened 7 years ago

SuprDewd commented 7 years ago

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.

akc commented 7 years ago

This can already be done. Maybe not the prettiest, but here are the Fibonacci numbers:

> evalCorePrg (emptyEnv :: Env 5) [Let "f" (1 + (X+X^2)*Var "f")]
series (Proxy :: Proxy 5) [Val (1 % 1),Val (1 % 1),Val (2 % 1),Val (3 % 1),Val (5 % 1)]
SuprDewd commented 7 years ago

That's great, but a simpler way would be preferable.