Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Symbol a
- data Symbol' a
- singleton :: a -> NonEmpty a
- primPat :: [(Text, Symbol' Pattern)]
- pairPat :: Pattern -> Pattern -> Pattern
- primTypes :: [(Text, Symbol' SSing)]
- t2 :: (AST -> AST -> AST) -> Symbol AST
- t3 :: (AST -> AST -> AST -> AST) -> Symbol AST
- type SymbolTable = [(Text, Symbol AST)]
- primTable :: SymbolTable
- primPrimOp0 :: PrimOp -> Symbol AST
- primPrimOp1 :: PrimOp -> Symbol AST
- primPrimOp2 :: PrimOp -> Symbol AST
- primMeasure1 :: SomeOp MeasureOp -> Symbol AST
- primMeasure2 :: SomeOp MeasureOp -> Symbol AST
- primCoerce :: Coercion a b -> Symbol AST
- primUnsafe :: Coercion a b -> Symbol AST
- cProb2Real :: Coercion HProb HReal
- cNat2Prob :: Coercion HNat HProb
- cNat2Int :: Coercion HNat HInt
- cInt2Real :: Coercion HInt HReal
- cNat2Real :: Coercion HNat HReal
- unit_ :: AST
- true_ :: AST
- false_ :: AST
- unsafeFrom_ :: AST -> AST
- primLeft :: Symbol AST
- primRight :: Symbol AST
- primJust :: Symbol AST
- primNothing :: Symbol AST
- primWeight :: Symbol AST
- primFactor :: Symbol AST
- primBern :: Symbol AST
- two :: AST
- gensym :: Text -> State Int Name
- mkSym :: Name -> Symbol AST
- insertSymbol :: Name -> SymbolTable -> SymbolTable
- insertSymbols :: [Name] -> SymbolTable -> SymbolTable
- resolveBinder :: SymbolTable -> Text -> AST' Text -> AST' Text -> (Symbol AST -> AST' (Symbol AST) -> AST' (Symbol AST) -> AST' (Symbol AST)) -> State Int (AST' (Symbol AST))
- symbolResolution :: SymbolTable -> AST' Text -> State Int (AST' (Symbol AST))
- symbolResolveBranch :: SymbolTable -> Branch' Text -> State Int (Branch' (Symbol AST))
- symbolResolvePat :: Pattern' Text -> State Int (Pattern' Name, [Name])
- normAST :: AST' (Symbol AST) -> AST' (Symbol AST)
- branchNorm :: Branch' (Symbol AST) -> Branch' (Symbol AST)
- collapseSuperposes :: [AST] -> AST
- makeType :: TypeAST' -> SSing
- makePattern :: Pattern' Name -> Pattern
- makeBranch :: Branch' (Symbol AST) -> Branch
- makeTrue :: AST' (Symbol AST) -> Branch
- makeFalse :: AST' (Symbol AST) -> Branch
- makeAST :: AST' (Symbol AST) -> AST
- resolveAST :: AST' Text -> AST
- resolveAST' :: [Name] -> AST' Text -> AST
- makeName :: SomeVariable (KProxy :: KProxy Hakaru) -> Name
- fromVarSet :: VarSet (KProxy :: KProxy Hakaru) -> [Name]
Documentation
unsafeFrom_ :: AST -> AST Source #
primNothing :: Symbol AST Source #
primWeight :: Symbol AST Source #
primFactor :: Symbol AST Source #
insertSymbol :: Name -> SymbolTable -> SymbolTable Source #
insertSymbols :: [Name] -> SymbolTable -> SymbolTable Source #
resolveBinder :: SymbolTable -> Text -> AST' Text -> AST' Text -> (Symbol AST -> AST' (Symbol AST) -> AST' (Symbol AST) -> AST' (Symbol AST)) -> State Int (AST' (Symbol AST)) Source #
symbolResolution :: SymbolTable -> AST' Text -> State Int (AST' (Symbol AST)) Source #
Figure out symbols and types.
normAST :: AST' (Symbol AST) -> AST' (Symbol AST) Source #
Make AST and give unique names for variables.
The logic here is to do normalization by evaluation for our primitives. App inspects its first argument to see if it should do something special. Otherwise App behaves as normal.
collapseSuperposes :: [AST] -> AST Source #