val type_check : Ast.program -> (Ast.program, string) result