aboutsummaryrefslogtreecommitdiffstats
path: root/src/resp.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-12-14 05:29:49 +0000
committerDavid Robillard <d@drobilla.net>2012-12-14 05:29:49 +0000
commit32c1b78fc9bdadd1dd40ed390941b2a6fea39435 (patch)
treec02e3da8138d29ee060bd5bf584812bd9ad4ca5f /src/resp.hpp
parent60cb2bb1a12a1393abdc0d82b40ea0feabe3a74d (diff)
downloadresp-32c1b78fc9bdadd1dd40ed390941b2a6fea39435.tar.gz
resp-32c1b78fc9bdadd1dd40ed390941b2a6fea39435.tar.bz2
resp-32c1b78fc9bdadd1dd40ed390941b2a6fea39435.zip
Real implementation of algebraic data types, and parametric types.
git-svn-id: http://svn.drobilla.net/resp/trunk@434 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/resp.hpp')
-rw-r--r--src/resp.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/resp.hpp b/src/resp.hpp
index d6a46ab..8d37cd3 100644
--- a/src/resp.hpp
+++ b/src/resp.hpp
@@ -640,7 +640,17 @@ struct TEnv : public Env<const AST*> {
typedef map<const AST*, const AST*> Vars;
+ /// Discriminated Union Constructor
+ struct Constructor {
+ Constructor(const AST* x, const AST* t) : expr(x), type(t) {}
+ const AST* expr;
+ const AST* type;
+ };
+
+ typedef map<const std::string, Constructor> Tags;
+
Vars vars;
+ Tags tags;
PEnv& penv;
unsigned varID;
@@ -834,6 +844,7 @@ const AST* resp_simplify(CEnv& cenv, const AST* ast) throw();
const AST* resp_cps(CEnv& cenv, const AST* ast, const AST* k) throw();
const AST* resp_lift(CEnv& cenv, Code& code, const AST* ast) throw();
const AST* resp_flatten(CEnv& cenv, Code& code, const AST* ast) throw();
+const AST* resp_depoly(CEnv& cenv, Code& code, const AST* ast) throw();
CVal resp_compile(CEnv& cenv, const AST* ast) throw();
bool is_form(const AST* ast, const std::string& form);