589 case try_unsuffixes ats s of |
589 case try_unsuffixes ats s of |
590 SOME s => (constr Arg_Light, s) |
590 SOME s => (constr Arg_Light, s) |
591 | NONE => (constr Heavy, s)) |
591 | NONE => (constr Heavy, s)) |
592 | NONE => fallback s |
592 | NONE => fallback s |
593 |
593 |
|
594 fun is_mangled_arg_light poly level = |
|
595 poly = Mangled_Monomorphic andalso heaviness_of_level level = Arg_Light |
|
596 |
594 fun type_enc_from_string soundness s = |
597 fun type_enc_from_string soundness s = |
595 (case try (unprefix "poly_") s of |
598 (case try (unprefix "poly_") s of |
596 SOME s => (SOME Polymorphic, s) |
599 SOME s => (SOME Polymorphic, s) |
597 | NONE => |
600 | NONE => |
598 case try (unprefix "raw_mono_") s of |
601 case try (unprefix "raw_mono_") s of |
625 if heaviness_of_level level = Heavy then |
628 if heaviness_of_level level = Heavy then |
626 Simple_Types (Higher_Order, Mangled_Monomorphic, level) |
629 Simple_Types (Higher_Order, Mangled_Monomorphic, level) |
627 else |
630 else |
628 raise Same.SAME |
631 raise Same.SAME |
629 | _ => raise Same.SAME) |
632 | _ => raise Same.SAME) |
630 | ("guards", (SOME poly, _)) => Guards (poly, level) |
633 | ("guards", (SOME poly, _)) => |
631 | ("tags", (SOME Polymorphic, _)) => Tags (Polymorphic, level) |
634 if is_mangled_arg_light poly level then raise Same.SAME |
632 | ("tags", (SOME poly, _)) => Tags (poly, level) |
635 else Guards (poly, level) |
|
636 | ("tags", (SOME poly, _)) => |
|
637 if is_mangled_arg_light poly level then raise Same.SAME |
|
638 else Tags (poly, level) |
633 | ("args", (SOME poly, All_Types (* naja *))) => |
639 | ("args", (SOME poly, All_Types (* naja *))) => |
634 Guards (poly, Const_Arg_Types) |
640 Guards (poly, Const_Arg_Types) |
635 | ("erased", (NONE, All_Types (* naja *))) => |
641 | ("erased", (NONE, All_Types (* naja *))) => |
636 Guards (Polymorphic, No_Types) |
642 Guards (Polymorphic, No_Types) |
637 | _ => raise Same.SAME) |
643 | _ => raise Same.SAME) |