#pragma once #include #include "type.hpp" #include "ast.hpp" namespace lily { class type_env { private: type_env* parent = nullptr; std::map identifier_types; public: bool identifier_exists(const std::string& name); type* get_identifier_type(const std::string& name); void unify(type* l, type* r); std::shared_ptr with_type(const std::string& name, type* ntype); void set_type(const std::string& name, type* ntype); void set_parent(type_env* new_parent); }; }