package reason

  1. Overview
  2. Docs
Reason: Syntax & Toolchain for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

reason-3.8.2.tbz
sha256=7adcc45db20b8def82adf2712211fb8ed844328489752e8edf74281bc1eb2ef2
sha512=45822ecf4b19b892e1d150fd7f7a80af18df576b204647d4bbb9a18ac591a690f9b5338789ecccacb2d6b6354dbc32ff4a3574cc8b82b777e21cb8729f502f95

doc/reason.ocaml-migrate-parsetree/Reason_omp/Ast_io/index.html

Module Reason_omp.Ast_io

type ast =
  1. | Impl : (module Reason_omp__.Migrate_parsetree_versions.OCaml_version with type Ast.Parsetree.structure = 'concrete) * 'concrete -> ast
  2. | Intf : (module Reason_omp__.Migrate_parsetree_versions.OCaml_version with type Ast.Parsetree.signature = 'concrete) * 'concrete -> ast

A marshalled ast packs the ast with the corresponding version of the frontend

type filename = string

A simple alias used for the filename of the source that produced an AST

type read_error =
  1. | Not_a_binary_ast of string
    (*

    The input doesn't contain a binary AST. The argument corresponds to the bytes from the input that were consumed.

    *)
  2. | Unknown_version of string
    (*

    The input contains a binary AST for an unknown version of OCaml. The argument is the unknown magic number.

    *)
val from_channel : in_channel -> (filename * ast, read_error) Result.result

Load a marshalled AST from a channel

Any exception raised during unmarshalling (see Marshal) can escape.

val from_bytes : bytes -> int -> (filename * ast, read_error) Result.result

Load a marshalled AST from a byte string.

See from_channel description for exception that can be raised.

val to_channel : out_channel -> filename -> ast -> unit

Marshal an AST to a channel

val to_bytes : filename -> ast -> bytes

Marshal an AST to a byte string

OCaml

Innovation. Community. Security.