Commits

camlspotter committed e0411f2

update

  • Participants
  • Parent commits f8c7462

Comments (0)

Files changed (1)

       let _, str =  o#structure str in
       str
 
-Here is (some part of) the code of the mod. It is a function of ``Typedtree.structure -> Typedtree.structure``, but we are only interested in the uses of identifiers whose definitions are by primitives ``OVERLOADED``. So the boilerplate code to dig into the AST data types I used a generic map class ``Ttmap`` created by a CamlP4 hack. For each identifier whose definition is ``OVERLOADED`` is converted by the function ``resolve_overloading`` function.
+Here is (some part of) the code of the mod. It is a function of ``Typedtree.structure -> Typedtree.structure``, but we are only interested in the uses of identifiers whose definitions are by primitives ``OVERLOADED``. I used a generic map class ``Ttmap`` created by a CamlP4 hack to skip the boilerplate code to dig into the AST. For each identifier whose definition is ``OVERLOADED`` is converted by the function ``resolve_overloading`` function.
 
-The actual overload resolution is quite simple, if you know the internals of OCaml type-checker. But if you don't, it is just too painful to read. So it is skipped :^) (see ``mod.ml`` if you are really interested). The big picture is: traverse the module which defines the primitive to find the values with the same name, then filter out those which do not match the context type. If there is none left, error. If there are more than one matches, error. If there is only one candidate, replace the primitive use by the candidate variable.
+The actual overload resolution is quite simple, if you know the internals of OCaml type-checker. But if you don't, it is just too painful to read. So it is skipped :^) (see ``mod.ml`` if you are really interested). The big picture is: traverse the module which defines the primitive to find the values with the same name, then filter out those which do not match the context type. If there is none left, error. If there are more than one matches, error (ambiguous). If there is only one candidate, replace the primitive use by the candidate variable.
 
 Anyway, building and playing this mod is very easy::