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

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

Function Documentation

◆ mim_get_plugin()