Copyright | Anders Claesson 2015 2016 |
---|---|
Maintainer | Anders Claesson <anders.claesson@gmail.com> |
Safe Haskell | None |
Language | Haskell98 |
License : BSD-3
- module HOPS.GF.Series
- module HOPS.GF.Transform
- module HOPS.Pretty
- data Expr0
- data Expr1
- data Expr2
- data Expr3
- data Cmd
- newtype PackedPrg = PPrg ByteString
- newtype Prg = Prg {}
- type Name = ByteString
- nameSupply :: [Name]
- packPrg :: Prg -> PackedPrg
- vars :: CorePrg -> [Name]
- anums :: CorePrg -> [Int]
- insertVar :: ByteString -> Series n -> Env n -> Env n
- aNumPrg :: Int -> Prg
- tagPrg :: Int -> Prg
- data Core
- type CorePrg = [Core]
- core :: Prg -> CorePrg
- data Env n = Env {}
- emptyEnv :: Env n
- evalCorePrg :: KnownNat n => Env n -> CorePrg -> Series n
- evalCorePrgs :: KnownNat n => Env n -> [CorePrg] -> [Series n]
- parsePrg :: ByteString -> Maybe Prg
- parsePrgErr :: ByteString -> Prg
Documentation
module HOPS.GF.Series
module HOPS.GF.Transform
module HOPS.Pretty
A compact ByteString
representation of a Prg
.
A program is a list of commands, where a command is either a power series expression or an assignment.
type Name = ByteString Source #
nameSupply :: [Name] Source #
insertVar :: ByteString -> Series n -> Env n -> Env n Source #
Insert a variable binding into the given environment.
An environment holds a mapping from A-numbers to series, and a mapping from names to series (assignments).
evalCorePrg :: KnownNat n => Env n -> CorePrg -> Series n Source #
Evaluate a program in a given environment. E.g.
evalCorePrg (emptyEnv :: Env 4) [ log (1/(1-X)) ]
series (Proxy :: Proxy 4) [Val (0 % 1),Val (1 % 1),Val (1 % 2),Val (1 % 3)]
evalCorePrgs :: KnownNat n => Env n -> [CorePrg] -> [Series n] Source #
Evaluate a list of programs in a given environment.
parsePrgErr :: ByteString -> Prg Source #
Parse a program and possibly fail with an error.