#ifndef TYPECHECK_H
#define TYPECHECK_H

#include "language.h"

typedef struct {
  ValueType consumed[3];
  ValueType produced[3];
  unsigned consumed_count;
  unsigned produced_count;
} TypeInfo;

typedef struct {
  Arena arena;
  TypeInfo* items;
  size_t count;
  ValueType final_type;
} TypedProgram;

bool typecheck_program(const Program* program, TypedProgram* out, Error* error);
void typed_program_destroy(TypedProgram* typed);

#endif