package reason
 sectionYPositions = computeSectionYPositions($el), 10)"
  x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
  >
  
  
On This Page
  
  
  Reason: Syntax & Toolchain for OCaml
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
  
    
      reason-3.12.0.tbz
    
    
        
    
  
  
  
    
  
  
    
  
        sha256=63d950affbe203701a3d4c076a2750b56211bae7017cd8f59da508efb09a1afe
    
    
  sha512=3ed24f4567dcf2ef2c05cec45fae18da2b9a78dab098a8e97e6430aaed4c8e3f659c7a5ccab88bce498c4b3d3cd54b01e72b2be4fefdf9f3bfcc2c8eb7fd86d4
    
    
  doc/reason.ocaml-migrate-parsetree/Reason_omp/Versions/index.html
Module Reason_omp.VersionsSource
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_functionsMigrations 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_migrationConvenience definitions
Module level migration
 sectionYPositions = computeSectionYPositions($el), 10)"
  x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
  >
  
  
  On This Page