lean4-htt/src/library/vm/vm_io.h
2017-03-23 14:29:07 -07:00

23 lines
778 B
C++

/*
Copyright (c) 2016 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <string>
#include "library/vm/vm.h"
namespace lean {
vm_obj mk_io_result(vm_obj const & r);
vm_obj mk_io_interface();
/* The io monad produces a result object, or an error.
If `o` is a result, then we return the result value. */
optional<vm_obj> is_io_result(vm_obj const & o);
/* The io monad produces a result object, or an error.
If `o` is an error, then we return the io.error value. */
optional<vm_obj> is_io_error(vm_obj const & o);
/* Convert an io.error object into a string */
std::string io_error_to_string(vm_obj const & o);
void initialize_vm_io();
void finalize_vm_io();
}