Ohhh... that is interesting. (TL;DR: problem solved, and it was from inappropriate Oo.id use.)
Modifier.attach is actually implemented as a function of one argument which does some stuff,
returning a function of two arguments, to avoid redundant lookups in the case of multiple "attach"
to the same "id".
When I remove the let m = ... and just inline "Modifer.attach id ..." the type of Modifier.attach changes to:
Db.key -> int * (((< _.. > as 'a) list -> exn) * (exn -> 'a list) -> 'a -> Modifier.deleter
So, 'a becomes: (< _.. > as 'a) -- I get some monomorphic... object?
As I wrote this I had an idea and found the problem:
...
(* return (tbl -> unit) function which deletes this specific function *)
let del_id = Oo.id fn in
(fun tbl ->
let lst = List.filter (fun e -> Oo.id e <> del_id) (fn_list tbl) in
Hashtbl.replace tbl tag (inj lst))
Here, "fn" is the provided function, and I want an easy way to remove such functions uniquely from the
mess of Hashtbl, universal embedding, and list. I tried a trick I once read Alain suggest for getting a
unique id using the object module... and I guess that brought in this <..> thing I was unfamiliar with. :)
Instead of Oo.id I'm using Hashtbl.hash now, which is normally what I'd do... not sure why I
half-remembered some trick with Oo.id.
Thank-you for looking at this, both of you. It helped me dig in the right direction!