<_zack>
rwmjones: if you don't mind I'll also merge in the zack/examples branch, it contains a copy of your introductory blog post on how to use ocaml-autoconf with automake
<rwmjones>
sure
<_zack>
rwmjones: can I relicense gtk gtk_test.tml example under the same license of ocaml-autoconf? (if not I'll have trouble in Debian ...)
<rwmjones>
_zack, sure, no problem
<_zack>
rwmjones: thanks
munga has quit [Read error: 113 (No route to host)]
smimram has quit [Read error: 110 (Connection timed out)]
smimram has joined #ocaml
verte has joined #ocaml
julm_ has quit [Read error: 60 (Operation timed out)]
julm has joined #ocaml
ikaros has joined #ocaml
<Yoric[DT]>
rwmjones: thanks
julm_ has joined #ocaml
julm has quit [Read error: 145 (Connection timed out)]
<thelema>
rwmjones: do I need to do anything at that web page?
<rwmjones>
thelema, not really ... there is one patch that we applied:
<rwmjones>
thelema, well ... at the moment you can't supply a custom path for "DESTDIR" (BTW you shouldn't use the name "DESTDIR" for this purpose, but that's a separate issue)
<rwmjones>
and the default path is /usr/lib/batteries which is no use to us
spaceBARbarian has joined #ocaml
<spaceBARbarian>
anyone know what expression can get me the type int -> (int -> bool) ?
<rwmjones>
thelema, but the second issue is that we'd like to be able to specify that directory to configure (like we can do with docroot)
<thelema>
rwmjones: I'm poor at configure, but have been learning
<thelema>
spaceBARbarian: (<)
<thelema>
err... ( (<) : int -> int -> bool)
<thelema>
spaceBARbarian: "fun x y -> x+1 = y"
RLa has joined #ocaml
<rwmjones>
he probably wants something like: let make_fun x = fun y -> y > x
<spaceBARbarian>
thelema>> isnt that (int -> int) -> bool
<thelema>
spaceBARbarian: no, it's int -> int -> bool, and since -> is right associative, this is the same as int -> (int -> bool)
<rwmjones>
hmm scrap my suggestion :-)
<spaceBARbarian>
thelema>> hmm then what would give (int -> int) -> bool
<thelema>
spaceBARbarian: an example of (int -> int) -> bool: "fun f -> f 3 = 2"
Spiwack has joined #ocaml
<spaceBARbarian>
thelema>> can you explain how that last type is inferred, because there are no parameters in f so how do you get the two ints
<thelema>
rwmjones: how should DESTDIR interact with findlib?
<flux>
spacebarbarian, as you can see, an integer is applied to 'f', so f must be a function from integers
<thelema>
spaceBARbarian: f is used as "f 3", so it must take an int as argument. And the result is compared with 2: "= 2"
<flux>
spacebarbarian, and it is compared with function ('a -> 'a -> bool) to an integer 2 (so 'a = int)
<thelema>
so the result must be an int. Thus f is int -> int
<rwmjones>
thelema, it shouldn't .. don't use DESTDIR except in custom-written install rules (ie. never). For OCaml programs we (Fedora/Debian) set OCAMLFIND_DESTDIR before the install, which ocamlfind knows what to do with
<rwmjones>
so you just do ocamlfind install ... (ie. nothing special)
<flux>
ocamlfind has OCAMLFIND_DESTDIR? nice to know :)
seanmcl has joined #ocaml
<thelema>
rwmjones: ok.
<spaceBARbarian>
thelema>> wouldnt this create an infinite recursion ? refering to f in the definition of f ?
<thelema>
spaceBARbarian: I'm not defining f
ikaros_ has joined #ocaml
<thelema>
let f f = f 3 = 2
<thelema>
This defines f
<spaceBARbarian>
right nvmt
<spaceBARbarian>
missed the 'fun'
ikaros has quit [Read error: 60 (Operation timed out)]
<spaceBARbarian>
can someone explain the difference between let and fun, and the use of -> within fun
<thelema>
[let foo x = ...] means [let foo = fun x -> ...]
<spaceBARbarian>
oh okay
lutter has joined #ocaml
ikaros_ is now known as ikaros
<kaustuv_>
After playing with Jun Furuse's type abbreviation display patch, I'm now more convinced than ever that type abbreviations need a programmer-driven "canonical" annotation, such as: type canonical ('a, 'b) pair = 'a * 'b. (It would be an error for a type to have two canonical abbreviations in scope.)
<flux>
hmm
<flux>
so if module A and module B do that
<flux>
(obviously, different declarations)
<flux>
and module C uses both modules..
<flux>
what would be an error? opening bot A and B?
verte has quit ["~~~ Crash in JIT!"]
<kaustuv_>
Good question. One possibility is that A and B should not both be openable in the same context. Another is that the, as long as they are different types, that the last declared one overrides earlier ones.
<kaustuv_>
Another possibility, thought not without its own faults, is to use something like Haskell's newtype. This lets the user control what type is displayed with no runtime cost.
* thelema
wants newtype
<thelema>
but newtype is something different than choosing how to display a type
<kaustuv_>
Sure, in Haskell newtype has other uses (eg. deriving instances), but for OCaml the pseudo constructor would basically only be used to constrain the type of patterns with no other type annotations
<thelema>
hmmm... I wouln't mind killing two birds with one stone
_unK has joined #ocaml
<thelema>
I think this functionality overlaps with private row types
shr3kst3r has joined #ocaml
julm_ is now known as julm
_unK has quit [Read error: 131 (Connection reset by peer)]
albacker has joined #ocaml
akappa has joined #ocaml
shr3kst3r has quit [Remote closed the connection]
ikaros has quit ["Leave the magic to Houdini"]
seanmcl has quit []
shr3kst3r has joined #ocaml
ikaros has joined #ocaml
ztfw` has joined #ocaml
albacker has quit [Read error: 110 (Connection timed out)]
Alpounet has joined #ocaml
ztfw has quit [Read error: 110 (Connection timed out)]
spaceBARbarian has quit ["Leaving"]
lutter has quit ["Leaving."]
_unK has joined #ocaml
seanmcl has joined #ocaml
lutter has joined #ocaml
thrasibule has joined #ocaml
Alpounet has quit [Read error: 60 (Operation timed out)]
ski_ has quit ["Lost terminal"]
Submarine has joined #ocaml
spaceBARbarian has joined #ocaml
<spaceBARbarian>
thelema, is there any way to get ocaml to actually print int->(int -> bool) ?
<thelema>
spaceBARbarian: no, the compiler uses as few parentheses as possible
<spaceBARbarian>
ah
<kaustuv_>
why do you want types to be *less* readable?
<spaceBARbarian>
and what does the api mean by "bound" when it talks about Hashtbl.mem tbl x ?
<thelema>
spaceBARbarian: "bound" = stored in the hashtable
<spaceBARbarian>
then whats the purpose of hashtbl.find ?
<spaceBARbarian>
oh wow nvm
<thelema>
to get the data that's stored with a given key
<spaceBARbarian>
lol
julm_ has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
julm has quit [Read error: 110 (Connection timed out)]
Alpounet has joined #ocaml
Alpounet has quit ["Leaving"]
kaustuv_` has joined #ocaml
_zack has quit ["Leaving."]
<shazam>
hrmph
* shazam
is thinking of submitting to JFLA
<shazam>
but my french sucks!
shazam is now known as palomer
kaustuv_ has quit [Read error: 110 (Connection timed out)]
<palomer>
oh wait, it can be written in english
onigiri has joined #ocaml
|Jedai| has quit ["KVIrc Insomnia 4.0.0, revision: , sources date: 20090115, built on: 2009/03/07 00:45:02 UTC http://www.kvirc.net/"]
seanmcl has quit []
<thelema>
palomer: you just have to present in french
mbac has joined #ocaml
<mbac>
so i've selected a binary tree because i like the O(nlogn)ish lookup behavior but the data i have to load is sorted so inserts are O(N). is there something i should do that's less ugly than shuffling the list that i'm using to populate the tree in the startup phase?
<flux>
mbac, do you use your own data structure or the one from the standard library?
<mbac>
rolling my own, naturally
Snark has joined #ocaml
<mbac>
er, O(logn) behavior
<akappa>
mbac, a balanced tree
<mbac>
so the concensus is that the initial shuffle is *so* ugly that it's worth the added complexity of switching to a balanced tree
<thelema>
mbac: binary trees should have log n lookup.
<flux>
mbac, so do you modify data after initialization?
<mbac>
no
<flux>
mbac, then how about a sorted array?
<flux>
and do binary searches on it
<mbac>
additional economic factors: the code exists and works as i described
<flux>
:)
<flux>
then just do the shuffle and be happy :)
<mbac>
haha i guess i'm asking is the shame of keeping a list shuffle in your code enough to compel you to change the algorithm
<flux>
I don't know how easy it is to find the optimal shuffling for a sequence of (sorted) data
<thelema>
if you want, you could do an optimized shuffle to insert the n/2th element, and then n/4, 3n/4, etc
<thelema>
it's pretty straightforward to do it recursively
<mbac>
well it's tolerably fast, just asking an aesthetics question mostly
<mbac>
well, thanks for trying :D
mbac has left #ocaml []
thrasibule has quit [Read error: 110 (Connection timed out)]
spaceBARbarian has quit [Read error: 110 (Connection timed out)]
Spiwack has quit ["Leaving"]
julm_ is now known as julm
seanmcl has joined #ocaml
Narrenschiff has joined #ocaml
thrasibule has joined #ocaml
palomer has quit [Read error: 104 (Connection reset by peer)]
albacker has joined #ocaml
RLa has quit ["Leaving"]
lutter has quit ["Leaving."]
Snark has quit ["Ex-Chat"]
lutter has joined #ocaml
Submarine has quit ["Leaving"]
<_unK>
http://codepad.org/HVey7rg1 is there any other way to invoke info function than putting it in let _ = ... in ?
<Camarade_Tux>
well, you have 'let () = info some_string in' which is a bit more strict and 'info some_string;'
<thelema>
you want to use ;
<flux>
_unk, that's the way to go
<flux>
_unk, (although an alternative would be ;; and putting the call after that)