PreviousUpNext

14.5.47  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/typer-stuff/types/types.api.

The above information is manually maintained and may contain errors.

api {    Label ;
    Type_Scheme_Arg_Eq_Properties ;
    package eq_type : api {
                          Info 
                            = CHUNK
                            | DATA
                            | EQ_ABSTRACT
                            | INDETERMINATE
                            | NO
                            | UNDEF
                            | YES;
                      };;
    Literal_Kind  = CHAR | FLOAT | INT | STRING | UNT;
    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:line_number_db::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};
    Typ_Path 
      = TYPPATH_APPLY (Typ_Path , List(Typ_Path ))
      | TYPPATH_GENERIC (List(Typ_Path ) , List(Typ_Path ))
      | TYPPATH_SELECT (Typ_Path , Int)
      | TYPPATH_TYP Typ
      | TYPPATH_VARIABLE Exception;
    Typ_Kind 
      = ABSTRACT Typ
      | BASE Int
      | DATATYPE {family:Datatype_Family,  free_typs:List(Typ ), 
                  index:Int,  root:Null_Or(stamp::Stamp ), 
                  stamps:?.Vector(stamp::Stamp )}
      | FLEXIBLE_TYP Typ_Path
      | FORMAL
      | TEMP;
    Typ 
      = DEFINED_TYP {path:?.inverse_path::Inverse_Path, 
                     stamp:stamp::Stamp,  strict:List(Bool ), 
                     type_scheme:Type_Scheme}
      | ERRONEOUS_TYP
      | FREE_TYPE Int
      | PLAIN_TYP Plain_Typ_Record
      | RECORD_TYP List(Label )
      | RECURSIVE_TYPE Int
      | TYP_BY_STAMPPATH {arity:Int,  path:?.inverse_path::Inverse_Path, 
                          stamppath:?.stamppath::Stamppath};
    Type 
      = TYPCON_TYPE (Typ , 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 ),  form:varhome::Valcon_Form, 
                                name:symbol::Symbol};
    Datatype_Member  = {an_api:varhome::Valcon_Signature,  arity:Int, 
                        constructor_list:List(Constructor_Description ), 
                        eqtype_info:Ref(eq_type::Info ),  is_lazy:Bool, 
                        typ_name:symbol::Symbol};
    Datatype_Family  =
      {members:?.Vector(Datatype_Member ), 
       mkey:stamp::Stamp, 
       property_list:property_list::Property_List};
    Stub_Info  =
      {is_lib:Bool,  owner:picklehash::Picklehash};
    Plain_Typ_Record  =
      {arity:Int,  eqtype_info:Ref(eq_type::Info ), 
       kind:Typ_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;
    Valcon 
      = VALCON {form:varhome::Valcon_Form,  is_constant:Bool, 
                is_lazy:Bool,  name:symbol::Symbol, 
                signature:varhome::Valcon_Signature,  type:Type};
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext