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 Expr
- data Expr0
- data Expr1
- data Expr2
- data Expr3
- newtype PackedExpr = PackedExpr ByteString
- type Name = ByteString
- nameSupply :: [Name]
- packExpr :: Expr -> PackedExpr
- vars :: Core -> [Name]
- anums :: Core -> [Int]
- insertVar :: ByteString -> Series n -> Env n -> Env n
- aNumExpr :: Int -> Expr
- tagExpr :: Int -> Expr
- data Core
- core :: Expr -> Core
- data Env n = Env {}
- emptyEnv :: Env n
- evalCore :: KnownNat n => Core -> State (Env n) (Series n)
- evalCore' :: KnownNat n => Env n -> Core -> Series n
- parseExpr :: ByteString -> Maybe Expr
- parseExprErr :: ByteString -> Expr
Documentation
module HOPS.GF.Series
module HOPS.GF.Transform
module HOPS.Pretty
newtype PackedExpr Source #
A compact ByteString
representation of a Prg
.
type Name = ByteString Source #
nameSupply :: [Name] Source #
packExpr :: Expr -> PackedExpr Source #
A compact representation of an Expr
as a wrapped ByteString
.
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).
evalCore :: KnownNat n => Core -> State (Env n) (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)]
parseExprErr :: ByteString -> Expr Source #
Parse a program and possibly fail with an error.