You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an example showing how varying the order of instance bindings affects whether the search succeeds:
m.ml:
module type T=sigtype 'a t type s end
implicit moduleT_option=structtype 'a t = 'a optiontype s =intend
implicit moduleT_list=structtype 'a t = 'a listtype s =intend
implicit moduleT_two=structtype 'a t = 'a * 'a type s =boolend
implicit functorF (L: T) (R: T) =structtype'a t = 'aL.tR.ttypes = R.s*L.sendletf (implicit N: T with type s = bool * int) (v: float N.t) : unit =()let x = f (Some1.0, Some2.0)
n.ml:
module type T=sigtype 'a t type s end
implicit moduleT_list=structtype 'a t = 'a listtype s =intend
implicit moduleT_option=structtype 'a t = 'a optiontype s =intend
implicit moduleT_two=structtype 'a t = 'a * 'a type s =boolend
implicit functorF (L: T) (R: T) =structtype'a t = 'aL.tR.ttypes = R.s*L.sendletf (implicit N: T with type s = bool * int) (v: float N.t) : unit =()let x = f (Some1.0, Some2.0)
Compiling:
$ ocamlc m.ml &&echo ok
File "m.ml", line 14, characters 8-9:
Error: No instance found for implicit N.
$ ocamlc n.ml &&echo ok
ok
$
The text was updated successfully, but these errors were encountered:
Here's an example showing how varying the order of instance bindings affects whether the search succeeds:
m.ml:
n.ml:
Compiling:
The text was updated successfully, but these errors were encountered: