<thelema>
let diff to_ranges ~rs_in ~rs_out = not (eq Enum.singleton to_ranges rs_in rs_out)
<thelema>
but diff has type: (int * int -> (int * int) BatEnum.t) -> rs_in:(int * int, 'a) RS.t -> rs_out:(int * int, 'a) RS.t -> bool
avsm has joined #ocaml
<thelema>
I'm expecting to be able to have rs_out have type ('b,'a) RS.t, and diff's first parameter to be ('b -> (int*int) Enum.t)
<thelema>
hmm, looking at the types again, the problem is in eq, as it's unified the 'a for both RS.t's
<thelema>
ah, it's the fault of Option.eq having type `?eq:('a -> 'a -> bool) -> 'a option -> 'a option -> bool` when I want ('a -> 'b -> bool) -> 'a option -> 'b option -> bool
avsm has quit [Quit: Leaving.]
bobry1 has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
Boscop_ has left #ocaml []
ttamttam has quit [Remote host closed the connection]
joewilliams_away is now known as joewilliams
<thelema>
Do any type theorists have a way to have Option.eq have type `?eq:('a -> 'b -> bool) -> 'a option -> 'b option -> bool` with ~eq defaulting to (=)?
<zorun>
write an Option.eq2 function?
<thelema>
yup, but it'd be nice to not need two functions just to have a default comparator
<thelema>
two identical functions except for the default on ~eq, even.
<flux>
thelema, no, there is no way
<flux>
you think you could do it with Obj.magic, but no
<thelema>
I imagine using Obj.magic would break (=)
<flux>
the thing is, how would it know that you cannot call Option.eq (Some 1) (Some 1.0)? option types are basically just syntax candy for non-optional types that have type 'a option and that ocaml has no overloading
<flux>
I guess it could work if it were a feature of the call site to fill in the default parmaeters
<thelema>
I think the type of `Option.eq (Some 1)` could be clearly identified as `int option -> bool`
ulfdoz has joined #ocaml
<thelema>
it would take more work on the part of the typechecker to "apply" the default function and re-infer the type. I guess avoiding this ugliness is reasonable.
avsm has quit [Quit: Leaving.]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
blinky- has joined #ocaml
Anarchos has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<mfp>
thelema: there was a blogpost by lexify about a patch to the compiler that added implicit parameters allowing to do something along that line IIRC
tnguyen has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
betta_y_omega has quit [Ping timeout: 258 seconds]
betta_y_omega has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
edwin has quit [Remote host closed the connection]
jamii has joined #ocaml
mdmkolbe has joined #ocaml
<mdmkolbe>
I believe the checksum for godi-ocaml-manual (3.12) is wrong in godi. Is anyone here involved in that?
jimmyrcom has quit [Ping timeout: 240 seconds]
Associat0r has quit [Quit: Associat0r]
Morphous has quit [Ping timeout: 245 seconds]
blinky- has quit [Quit: /quit]
mdmkolbe has quit [Quit: Leaving.]
joewilliams is now known as joewilliams_away
mdmkolbe has joined #ocaml
mdmkolbe has quit [Client Quit]
mdmkolbe has joined #ocaml
mdmkolbe has quit [Client Quit]
joewilliams_away is now known as joewilliams
mdmkolbe has joined #ocaml
joewilliams has quit [Changing host]
joewilliams has joined #ocaml
joewilliams is now known as joewilliams_away
mdmkolbe has quit [Client Quit]
mdmkolbe has joined #ocaml
BiDOrD has joined #ocaml
joewilliams_away is now known as joewilliams
Morphous has joined #ocaml
BiDOrD_ has quit [Ping timeout: 258 seconds]
mdmkolbe has quit [Quit: Leaving.]
mdmkolbe has joined #ocaml
mdmkolbe has quit [Quit: Leaving.]
ikaros has quit [Quit: Ex-Chat]
jamii has quit [Read error: Operation timed out]
joewilliams is now known as joewilliams_away
lopex has joined #ocaml
lopex has quit []
avsm has joined #ocaml
dnolen has joined #ocaml
avsm has quit [Quit: Leaving.]
<_habnabit>
is there a way to just declare an interface in ocaml?
<_habnabit>
like I have an object that implement some interface, and I'm going to write more. but I'm not sure what to do for the signatures of things.
<_habnabit>
er, that was a little vague.
<_habnabit>
say I have Impl_a.t and Impl_b.t, which implement #interface. if I wanted to make M.do: #interface -> unit, how would I declare #interface?