package reason
Reason: Syntax & Toolchain for OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
reason-3.16.0.tbz
sha256=47b0e43a7d348e2a850658ab4bec5a4fbbb9fd4ff3ec8a1c1816511558c5364e
sha512=0d8dbe33ac17b765ea018522910a333831fec278ae4da25ba039ce4d2d8152f9b2fbba5b40c453241bf4323e55e0dc070170b04caa35742c6e33a7f726feafb3
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