<ski>
(maybe better still, to use a more suitable datastructure)
<oracle1>
ok
mellum has joined #ocaml
<mellum>
Is there some efficient way to do "unsigned less than" for two integers?
* Demitar
wonders what kind of evil inner loop mellum is using for that to even matter... :)
Msandin has quit [Read error: 110 (Connection timed out)]
Banana_ has joined #ocaml
Banana has quit [Read error: 104 (Connection reset by peer)]
y6cmE has joined #ocaml
Hadaka has quit [Remote closed the connection]
Naked has joined #ocaml
Naked is now known as Hadaka
Tachyon76 has joined #ocaml
smimou has joined #ocaml
Tachyon76 has quit ["Leaving"]
Hadaka has quit [Read error: 104 (Connection reset by peer)]
chs has joined #ocaml
Schmurtz has quit [Read error: 113 (No route to host)]
Snark has quit ["Leaving"]
<chs>
It seems that the only handily available implementation of imperative sets is Hashtbl with replace as insert and fold for element extraction. Is that true?
Snark has joined #ocaml
<chs>
Oh, I found Garrigue's Oset but that does not seem to be in wide use, eg not packaged by Debian.
Schmurtz has joined #ocaml
<Demitar>
chs, look in extlib.
Naked has joined #ocaml
Naked is now known as Hadaka
<chs>
I did, but all it has is functions (exists & keys) which make Hashtbl's use as destructive set more palatable.
<chs>
Anyway, it works. It's just not where you would look for such a functionality in the beginning.
<Smerdyakov>
Wrap it with a functor?
y6cmE has quit [Read error: 110 (Connection timed out)]
<chs>
Sure I could wrap it (altho I don't see why that would be a functor and not a regular module), but I'm only asking about this because I'm amazed that these very basic data types don't seem to be commonly available.
<Smerdyakov>
Oh, you're using the polymorphic Hashtbl?
<chs>
Ok, maybe I don't understand, but Hashtbl.t is polymorphic and it's the only thing provided by (Ext)Hashtbl, iirc.
<Smerdyakov>
Look at the part labeled "functorial interface" in the Hashtbl docs.
<chs>
Hmm, why would I use that unless I really care about performance or have a special kind of equality requirement?
<chs>
Anyway, you're right. I overlooked that interface.
<Smerdyakov>
Because polymorphic hashing is hacky?
<lightstep>
so it isn't possible. but why is it so? why isn't (?l:a->b) a subtype of (~l:a->b)?
<mikeX>
beats me
<mikeX>
but type inference is quite limited when it comes to optional arguments and classes...
<beschmi>
lightstep: perhaps because (?l:a -> b) is implemented as (~l: (a -> b) option)
<lightstep>
implementation choices hardly seem like a good reason especially when other languages (even c++) uses the caller-decides convention successfully)
aegray has left #ocaml []
<Smerdyakov>
Currying makes things fundamentally more interesting.
Schmurtz has quit ["Dodo !"]
Banana_ has quit [Read error: 104 (Connection reset by peer)]
Banana has joined #ocaml
mikeX has quit ["Leaving"]
<lightstep>
one solution is to have different syntax for optional and required parameters
<ski>
hm, possibly (a -> ?l:b -> c) could be a subtype of (a -> ~l:b -> c) and (a -> c) .. ?
<ski>
different syntax, how ?
<lightstep>
f ~l:v vs. f ~?l:v
<beschmi>
lightstep: let f g = g ?p:(Some "hello") .. works without the type annotation
<beschmi>
should be possible to implement ~?l:v => ?l:(Some v) with camlp4
<lightstep>
thanks, i didn't see this in the manual
Gueben has quit [Remote closed the connection]
Schmurtz has joined #ocaml
faigo has joined #ocaml
ski has quit [Read error: 110 (Connection timed out)]