MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
clos.cpp File Reference
Include dependency graph for clos.cpp:

Go to the source code of this file.

Namespaces

namespace  mim
namespace  mim::plug
namespace  mim::plug::clos
 The clos Plugin

Functions

void reg_stages (Flags2Stages &stages)
Plugin mim_get_plugin ()
Closures
ClosLit mim::plug::clos::isa_clos_lit (const Def *def, bool fn_isa_lam=true)
 Tries to match a closure literal.
const Defmim::plug::clos::clos_pack (const Def *env, const Def *fn, const Def *ct=nullptr)
 Pack a typed closure. This assumes that fn expects the environment as its Clos_Env_Paramth argument.
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 Defmim::plug::clos::clos_apply (const Def *closure, const Def *args)
 Apply a closure to arguments.
Closure Types
const Sigmamim::plug::clos::isa_clos_type (const Def *def)
Sigmamim::plug::clos::clos_type (const Pi *pi)
 Creates a typed closure type from pi.
const Pimim::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
const Defmim::plug::clos::clos_insert_env (size_t i, const Def *env, std::function< const Def *(size_t)> f)
const Defmim::plug::clos::clos_remove_env (size_t i, std::function< const Def *(size_t)> f)
const Defmim::plug::clos::ctype (World &w, Defs doms, const Def *env_type=nullptr)

Function Documentation

◆ mim_get_plugin()

◆ reg_stages()

void reg_stages ( Flags2Stages & stages)

Definition at line 20 of file clos.cpp.

References mim::Stage::hook().