80: # 304 "./lpsrc/flx_types.ipk" 81: (** type of a type *) 82: and typecode_t = 83: [ 84: | `AST_void of range_srcref (** void type *) 85: | `AST_name of range_srcref * string * typecode_t list 86: | `AST_case_tag of range_srcref * int 87: | `AST_typed_case of range_srcref * int * typecode_t 88: | `AST_lookup of range_srcref * (expr_t * string * typecode_t list) 89: | `AST_the of range_srcref * qualified_name_t 90: | `AST_index of range_srcref * string * int 91: | `AST_callback of range_srcref * qualified_name_t 92: | `AST_suffix of range_srcref * (qualified_name_t * typecode_t) 93: | `AST_patvar of range_srcref * string 94: | `AST_patany of range_srcref 95: | `TYP_tuple of typecode_t list (** product type *) 96: | `TYP_unitsum of int (** sum of units *) 97: | `TYP_sum of typecode_t list (** numbered sum type *) 98: | `TYP_intersect of typecode_t list (** intersection type *) 99: | `TYP_record of (string * typecode_t) list (** anon product *) 100: | `TYP_variant of (string * typecode_t) list (** anon sum *) 101: | `TYP_function of typecode_t * typecode_t (** function type *) 102: | `TYP_cfunction of typecode_t * typecode_t (** C function type *) 103: | `TYP_pointer of typecode_t (** pointer type *) 104: | `TYP_array of typecode_t * typecode_t (** array type base ^ index *) 105: | `TYP_as of typecode_t * string (** fixpoint *) 106: | `TYP_typeof of expr_t (** typeof *) 107: | `TYP_var of int (** unknown type *) 108: | `TYP_none (** unspecified *) 109: | `TYP_ellipsis (** ... for varargs *) 110: | `TYP_lvalue of typecode_t (** ... lvalue annotation *) 111: | `TYP_isin of typecode_t * typecode_t (** typeset membership *) 112: 113: (* sets of types *) 114: | `TYP_typeset of typecode_t list (** discrete set of types *) 115: | `TYP_setunion of typecode_t list (** union of typesets *) 116: | `TYP_setintersection of typecode_t list (** intersection of typesets *) 117: 118: (* dualizer *) 119: | `TYP_dual of typecode_t (** dual *) 120: 121: (* destructors *) 122: | `TYP_dom of typecode_t (** function domain extractor *) 123: | `TYP_cod of typecode_t (** function codomain extractor *) 124: | `TYP_proj of int * typecode_t (** tuple projection *) 125: | `TYP_case_arg of int * typecode_t (** argument of n'th variant *) 126: 127: | `TYP_apply of typecode_t * typecode_t (** type function application *) 128: | `TYP_typefun of simple_parameter_t list * typecode_t * typecode_t 129: (** type lambda *) 130: | `TYP_type (** meta type of a type *) 131: | `TYP_type_tuple of typecode_t list (** meta type product *) 132: 133: | `TYP_type_match of typecode_t * (typecode_t * typecode_t) list 134: 135: | `TYP_glr_attr_type of qualified_name_t 136: 137: (* Barry Jay pattern calculus case *) 138: | `TYP_case of typecode_t * string list * typecode_t 139: 140: | `TYP_lift of typecode_t (** lift type to metatype *) 141: ] 142: 143: and tpattern_t = 144: [ 145: | `TPAT_function of tpattern_t * tpattern_t 146: | `TPAT_sum of tpattern_t list 147: | `TPAT_tuple of tpattern_t list 148: | `TPAT_pointer of tpattern_t 149: | `TPAT_void 150: | `TPAT_var of string 151: | `TPAT_name of string * tpattern_t list 152: | `TPAT_as of tpattern_t * string 153: | `TPAT_any 154: | `TPAT_unitsum of int 155: | `TPAT_type_tuple of tpattern_t list 156: ] 157: 158: (* 159: and vs_list_t = (id_t * tpattern_t) list 160: and ivs_list_t = (id_t * int * tpattern_t) list 161: *) 162: and raw_typeclass_insts_t = qualified_name_t list 163: and vs_aux_t = { 164: raw_type_constraint:typecode_t; 165: raw_typeclass_reqs: raw_typeclass_insts_t 166: } 167: 168: and plain_vs_list_t = (id_t * typecode_t) list 169: and plain_ivs_list_t = (id_t * int * typecode_t) list 170: and vs_list_t = plain_vs_list_t * vs_aux_t 171: and ivs_list_t = plain_ivs_list_t * vs_aux_t 172: