package reason
Reason: Syntax & Toolchain for OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
reason-3.11.0.tbz
sha256=a58837f14a79f047c8eb99d5518aeb16ee64353574286cfd5b284c98a1a27250
sha512=28d6d1c3636e400614b1a7d8c78b0bbb5de143e259edf683139b75d2fd2013da8e1a6c58d11047e6853f1e559c387d233570665de0de646005197b5f4d6f4879
doc/reason.ocaml-migrate-parsetree/Reason_omp/Versions/index.html
Module Reason_omp.Versions
Source
Abstracting an OCaml frontend
Source
type 'a _types = 'a
constraint
'a =
< out_value : _
; out_type : _
; out_class_type : _
; out_module_type : _
; out_sig_item : _
; out_type_extension : _
; out_phrase : _ >
A version of the OCaml frontend packs the ast with type witnesses so that equalities can be recovered dynamically.
migration_info
is an opaque type that is used to generate migration functions.
An OCaml frontend versions an Ast, version number and some witnesses for conversion.
Source
type 'types ocaml_version =
(module OCaml_version
with type Ast.Outcometree.out_class_type = 'types get_out_class_type
and type Ast.Outcometree.out_module_type = 'types get_out_module_type
and type Ast.Outcometree.out_phrase = 'types get_out_phrase
and type Ast.Outcometree.out_sig_item = 'types get_out_sig_item
and type Ast.Outcometree.out_type = 'types get_out_type
and type Ast.Outcometree.out_type_extension = 'types get_out_type_extension
and type Ast.Outcometree.out_value = 'types get_out_value)
Representing an ocaml version in type language
Concrete frontend instances
Migrating between different versions
Source
type ('a, 'b) type_comparison =
| Lt : ('a, 'b) type_comparison
| Eq : ('a, 'a) type_comparison
| Gt : ('a, 'b) type_comparison
Source
type ('from, 'to_) migration_functions = {
copy_out_value : 'from get_out_value -> 'to_ get_out_value;
copy_out_type : 'from get_out_type -> 'to_ get_out_type;
copy_out_class_type : 'from get_out_class_type -> 'to_ get_out_class_type;
copy_out_module_type : 'from get_out_module_type -> 'to_ get_out_module_type;
copy_out_sig_item : 'from get_out_sig_item -> 'to_ get_out_sig_item;
copy_out_type_extension : 'from get_out_type_extension -> 'to_ get_out_type_extension;
copy_out_phrase : 'from get_out_phrase -> 'to_ get_out_phrase;
}
A record for migrating each AST construct between two known versions
Migrating to the same version is no-op
Source
val migration_compose :
('a, 'b) migration_functions ->
('b, 'c) migration_functions ->
('a, 'c) migration_functions
Migrations can be composed
Represent the next or previous version of an Ast
Source
type 'from immediate_migration =
| No_migration : 'from immediate_migration
(*Cannot migrate earliest or latest supported version
*)| Immediate_migration : ('from, 'to_) migration_functions * 'to_ ocaml_version -> 'from immediate_migration
(*Pack the migration functions and the new version
*)
Source
val immediate_migration :
'types ocaml_version ->
[< `Next | `Previous ] ->
'types immediate_migration
Convenience definitions
Module level migration
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page