Stability | experimental |
---|---|
Maintainer | developer@flocc.net |
Safe Haskell | None |
For more information please see http://www.flocc.net/
- embedFun :: Monad m => [(Idx, TyTerm)] -> Expr -> EmFunM m TyTerm
- fullySimplifyFun :: (MonadCatch m, Monad m) => TyTerm -> EmFunM m (TyTerm, [(TyTerm, TyTerm)])
- fullySimplifyFuns :: (MonadCatch m, Monad m) => TyTerm -> EmFunM m (TyTerm, [(TyTerm, TyTerm)])
- simplifyFunsInEnv :: (MonadCatch m, Monad m) => TyEnv -> EmFunM m (TyEnv, [(TyTerm, TyTerm)])
- showEmbeddedFuns :: TyTerm -> String
- applyDimGens :: (MonadCatch m, Monad m) => TyTerm -> EmFunM m (TyTerm, [TyConstr], [(TyTerm, TyTerm)])
- applyDimGensInEnv :: (MonadCatch m, Monad m) => TyEnv -> EmFunM m (TyEnv, [TyConstr], [(TyTerm, TyTerm)])
- getIdxTreeTy :: String -> (TyTerm, TyTerm) -> IntMap TyTerm
- getVarTreeTy :: String -> IntMap TyTerm -> TyTerm -> TyTerm
- getSimpleFunTy :: String -> TyTerm -> TyTerm -> TyTerm
- unembedFun :: Monad m => IntMap Expr -> TyTerm -> IdxMonad m (Maybe Expr)
- evalEmFunM :: Monad m => EmFunM m r -> IntMap Expr -> IntMap TySchemeEx -> IdxMonad m r
- isFunTerm :: TyTerm -> Bool
- areValidFuns :: [Idx] -> TyTerm -> Bool
- fromFBoth :: TyTerm -> [TyTerm]
Documentation
embedFun :: Monad m => [(Idx, TyTerm)] -> Expr -> EmFunM m TyTerm
embedFun expr. Returns a type term that represents the |function, if possible.
fullySimplifyFun :: (MonadCatch m, Monad m) => TyTerm -> EmFunM m (TyTerm, [(TyTerm, TyTerm)])
fullySimplify term. Keeps simplifying until no changes are made.
fullySimplifyFuns :: (MonadCatch m, Monad m) => TyTerm -> EmFunM m (TyTerm, [(TyTerm, TyTerm)])
simplifyFuns t. Simplifies all sub terms that are embedded functions. |Calls simplifyFun twice so that after built in functions are expanded, they are applied.
showEmbeddedFuns :: TyTerm -> String
applyDimGens :: (MonadCatch m, Monad m) => TyTerm -> EmFunM m (TyTerm, [TyConstr], [(TyTerm, TyTerm)])
applyDimGens term. Applies all the dim generators that can be applied |in the current term, returning any new constraints created by the application.
applyDimGensInEnv :: (MonadCatch m, Monad m) => TyEnv -> EmFunM m (TyEnv, [TyConstr], [(TyTerm, TyTerm)])
applyDimGensInEnv env. Applies all dim generators in the env, and |returns any constraints that they create.
getIdxTreeTy :: String -> (TyTerm, TyTerm) -> IntMap TyTerm
getIdxTreeTy (idxTerm, ty). Returns an environment mapping var idxs to type terms.
getVarTreeTy :: String -> IntMap TyTerm -> TyTerm -> TyTerm
getVarTreeTy env term. Returns the type of term by looking up the types of vars in env, and |composing tuples of these together. NOTE: Will fail if more than just simple tuples of vars, |e.g. if it includes a function application!
getSimpleFunTy :: String -> TyTerm -> TyTerm -> TyTerm
getSimpleFunTy domTy funTerm. Returns the type of funTerm given |the domain type domTy, assuming funTerm is a simple tuple proj permute function.
unembedFun :: Monad m => IntMap Expr -> TyTerm -> IdxMonad m (Maybe Expr)
unembedFun term. Returns a function expr for the type |term, if this term if a function term.
evalEmFunM :: Monad m => EmFunM m r -> IntMap Expr -> IntMap TySchemeEx -> IdxMonad m r
areValidFuns :: [Idx] -> TyTerm -> Bool
areValidFuns term. Returns true if term is an embedded lambda |with args that are just tuples of vars. Also checks to make sure |that Vars (not VVars) and bound inside an FLet or an FFun.