From 979325946b938be7cbe51f8c20c44e457107979f Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 20 Nov 2016 21:05:01 +0100 Subject: Sugar and prelude extension --- sugar.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sugar.h (limited to 'sugar.h') diff --git a/sugar.h b/sugar.h new file mode 100644 index 0000000..1140ef3 --- /dev/null +++ b/sugar.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include +#include +#include +#include "ast.h" +#include "environment.h" + +using namespace std; + + +using Hook2 = function; +using Hook3 = function; + + +extern const unordered_map typeName; + +ostream& operator<<(ostream &os,AST::Type t); + +template +string stringify(const vector &v,const string &join=", "); + + +Hook checkedHook(const Name &name, + const vector &types, + const Hook &func); + +Hook checkedHook(const Name &name, + const vector &types1,const vector &types2, + const Hook2 &func); + +Hook checkedHook(const Name &name, + const vector &types1,const vector &types2,const vector &types3, + const Hook3 &func); -- cgit v1.2.3-70-g09d2