PreviousUpNext

14.5.31  Types

The compiler Types api defines access to type representation and manipulation functionality used in the front end.

The Types api is implemented by the types package.

The Types api source code is in src/lib/compiler/front/typecheck-stuff/types/types.api.

The above information is manually maintained and may contain errors.

api {    Label ;
    Type_Scheme_Arg_Eq_Properties ;
    Equality_Property 
      = CHUNK
      | DATA
      | EQ_ABSTRACT
      | INDETERMINATE
      | NO
      | UNDEF
      | YES;
    Literal_Kind  = CHAR | INT | REAL | STRING | WORD;
    Type_Variable 
      = INCOMPLETE_RECORD_TYPE_VARIABLE {eq:Bool,  fn_nesting:Int, 
                                         known_fields:List(((Label , Type)) )}
      | LITERAL_TYPE_VARIABLE {kind:Literal_Kind, 
                               source_code_region:source_map::Source_Code_Region}
      | META_TYPE_VARIABLE {eq:Bool,  fn_nesting:Int}
      | OVERLOADED_TYPE_VARIABLE Bool
      | RESOLVED_TYPE_VARIABLE Type
      | TYPE_VARIABLE_MARK Int
      | USER_TYPE_VARIABLE {eq:Bool,  fn_nesting:Int,  name:symbol::Symbol};
    Type_Constructor_Path 
      = TYPCONPATH_APPLY (Type_Constructor_Path , List(Type_Constructor_Path ))
      | TYPCONPATH_GENERIC (List(Type_Constructor_Path )
                            , List(Type_Constructor_Path ))
      | TYPCONPATH_SELECT (Type_Constructor_Path , Int)
      | TYPCONPATH_TYPE_CONSTRUCTOR Type_Constructor
      | TYPCONPATH_VARIABLE Exception;
    Type_Constructor_Kind 
      = ABSTRACT Type_Constructor
      | DATATYPE {family:Datatype_Family, 
                  free_type_constructors:List(Type_Constructor ), 
                  index:Int,  root:Null_Or(stamp::Stamp ), 
                  stamps:?.Vector(stamp::Stamp )}
      | FLEXIBLE_TYPE_CONSTRUCTOR Type_Constructor_Path
      | FORMAL
      | PRIMITIVE Int
      | TEMP;
    Type_Constructor 
      = DEFINED_TYPE_CONSTRUCTOR {path:?.inverse_path::Inverse_Path, 
                                  stamp:stamp::Stamp,  strict:List(Bool ), 
                                  type_scheme:Type_Scheme}
      | ERRONEOUS_TYPE_CONSTRUCTOR
      | FREE_TYPE Int
      | PRIMITIVE_TYPE_CONSTRUCTOR Primitive_Type_Constructor_Record
      | RECORD_TYPE_CONSTRUCTOR List(Label )
      | RECURSIVE_TYPE Int
      | TYPE_CONSTRUCTOR_BY_MODULE_PATH {arity:Int,  module_path:?.module_path::Module_Path, 
                                         path:?.inverse_path::Inverse_Path};
    Type 
      = CONSTRUCTOR_TYPE (Type_Constructor , List(Type ))
      | TYPE_SCHEME_ARG_I Int
      | TYPE_SCHEME_TYPE {type_scheme:Type_Scheme, 
                          type_scheme_arg_eq_properties:Type_Scheme_Arg_Eq_Properties}
      | TYPE_VARIABLE_REF Typevar_Ref
      | UNDEFINED_TYPE
      | WILDCARD_TYPE;
    Type_Scheme  = TYPE_SCHEME {arity:Int,  body:Type};
    Constructor_Description  =
      {domain:Null_Or(Type ),  name:symbol::Symbol, 
       representation:var_home::Constructor_Form};
    Datatype_Member  = {an_api:var_home::Constructor_Signature,  arity:Int, 
                        constructor_list:List(Constructor_Description ), 
                        eq:Ref(Equality_Property ),  is_lazy:Bool, 
                        type_constructor_name:symbol::Symbol};
    Datatype_Family  =
      {members:?.Vector(Datatype_Member ), 
       mkey:stamp::Stamp, 
       property_list:property_list::Property_List};
    Stub_Info  = {lib:Bool,  owner:picklehash::Picklehash};
    Primitive_Type_Constructor_Record  =
      {arity:Int,  eq:Ref(Equality_Property ), 
       kind:Type_Constructor_Kind, 
       path:?.inverse_path::Inverse_Path,  stamp:stamp::Stamp, 
       stub:Null_Or(Stub_Info )};
    Typevar_Ref  =
      {id:Int,  ref_typevar:Ref(Type_Variable )};
    infinity : Int;
    copy_type_variable_ref : Typevar_Ref -> Typevar_Ref;
    make_type_variable_ref : (Type_Variable , List(String )) -> Typevar_Ref;
    make_type_variable_ref' : (Ref(Type_Variable ) , List(String )) -> Typevar_Ref;
    Constructor  = ENUM_CONSTRUCTOR {const:Bool,  constructor_type:Type,  is_lazy:Bool, 
                                     representation:var_home::Constructor_Form, 
                                     signature:var_home::Constructor_Signature, 
                                     symbol:symbol::Symbol};
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext