Go to the source code of this file.
Classes | |
| class | mim::plug::clos::ClosLit |
| Lightweight, non-owning view onto a closure literal (env_type, fn, env); see isa_clos_lit. More... | |
Namespaces | |
| namespace | mim |
| namespace | mim::plug |
| namespace | mim::plug::clos |
| The clos Plugin | |
Functions | |
Closures | |
| ClosLit | mim::plug::clos::isa_clos_lit (const Def *def, bool fn_isa_lam=true) |
| Tries to match a closure literal. | |
| const Def * | mim::plug::clos::clos_pack (const Def *env, const Def *fn, const Def *ct=nullptr) |
| Pack a typed closure. | |
| std::tuple< const Def *, const Def *, const Def * > | mim::plug::clos::clos_unpack (const Def *c) |
| Deconstruct a closure into (env_type, function, env). | |
| const Def * | mim::plug::clos::clos_apply (const Def *closure, const Def *args) |
| Apply a closure to arguments. | |
| const Def * | mim::plug::clos::apply_closure (const Def *closure, Defs args) |
| template<class N> | |
| std::tuple< const Extract *, N * > | mim::plug::clos::isa_var_proj (const Def *def) |
If def is a projection var#i of the Var of some mutable of type N, returns (projection, binder). | |
Closure Types | |
| const Sigma * | mim::plug::clos::isa_clos_type (const Def *def) |
| Sigma * | mim::plug::clos::clos_type (const Pi *pi) |
Creates a typed closure type from pi. | |
| const Pi * | mim::plug::clos::clos_type_to_pi (const Def *ct, const Def *new_env_type=nullptr) |
Convert a closure type to a Pi, where the environment type has been removed or replaced by new_env_type (if new_env_type != nullptr). | |
Closure Environment | |
| size_t | mim::plug::clos::env_param (Defs doms) |
Describes where the environment is placed in the argument list: right after a leading mem.M, if doms starts with one, or in slot 0 otherwise. | |
| size_t | mim::plug::clos::env_param (const Pi *pi) |
| size_t | mim::plug::clos::shift_env (size_t ep, size_t i) |
| Adjust the index of an argument to account for the env param. | |
| size_t | mim::plug::clos::skip_env (size_t ep, size_t i) |
| Same as shift_env, but skips the env param instead. | |
| const Def * | mim::plug::clos::ctype (World &w, Defs doms, const Def *env_type=nullptr) |
Builds a closure type from the domains doms of a Cn. | |
| const Def * | mim::plug::clos::clos_insert_env (size_t ep, size_t i, const Def *env, std::function< const Def *(size_t)> f) |
| const Def * | mim::plug::clos::clos_insert_env (size_t ep, size_t i, const Def *env, const Def *a) |
| const Def * | mim::plug::clos::clos_insert_env (size_t ep, const Def *env, const Def *tup_or_sig) |
| const Def * | mim::plug::clos::clos_remove_env (size_t ep, size_t i, std::function< const Def *(size_t)> f) |
| const Def * | mim::plug::clos::clos_remove_env (size_t ep, size_t i, const Def *def) |
| const Def * | mim::plug::clos::clos_remove_env (size_t ep, const Def *tup_or_sig) |
| const Def * | mim::plug::clos::clos_sub_env (size_t ep, const Def *tup_or_sig, const Def *new_env) |