Alpounet changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
Serica has joined #ocaml
tomaw has quit [Read error: 60 (Operation timed out)]
tomaw has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
Ched has quit [Read error: 113 (No route to host)]
Smerdyakov has quit ["Leaving"]
jeddhaberstro has quit [Client Quit]
_unK has quit [Remote closed the connection]
onigiri has quit []
chahibi_ has joined #ocaml
mbishop has quit [Read error: 60 (Operation timed out)]
chahibi has quit [Read error: 110 (Connection timed out)]
julm has quit [Remote closed the connection]
julm has joined #ocaml
ski_ has joined #ocaml
caligula_ has quit [Read error: 104 (Connection reset by peer)]
caligula_ has joined #ocaml
verte has joined #ocaml
verte is now known as verte-work
Amorphous has quit [Connection timed out]
Amorphous has joined #ocaml
mbishop has joined #ocaml
bind_return has joined #ocaml
julm_ has joined #ocaml
julm has quit [Read error: 110 (Connection timed out)]
thrasibule has joined #ocaml
meltingwacks has quit [Read error: 104 (Connection reset by peer)]
meltingwax has joined #ocaml
seanmcl has quit []
rhar has joined #ocaml
thrasibule has quit [Read error: 60 (Operation timed out)]
bzzbzz has quit ["leaving"]
ikaros has joined #ocaml
ski_ has quit ["Lost terminal"]
ski_ has joined #ocaml
Serica has quit [Ping timeout: 180 seconds]
Yoric[DT] has joined #ocaml
verte-work has quit ["~~~ Crash in JIT!"]
mishok13 has joined #ocaml
f[x] has joined #ocaml
boringwall has joined #ocaml
<boringwall> Can I have a function that takes itself as a parameter?
kaustuv_ has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
kaustuv_` has quit [Read error: 110 (Connection timed out)]
_zack has joined #ocaml
rhar has quit ["This computer has gone to sleep"]
<flux> let f : ('a -> unit) -> unit = fun _ -> () is one such function, or do you mean something more general?
Ched has joined #ocaml
verte has joined #ocaml
munga has joined #ocaml
tmaedaZ is now known as tmaeda
Yoric[DT] has joined #ocaml
boringwall has quit [Read error: 60 (Operation timed out)]
<rwmjones> Yoric[DT], is this still needed / going to be needed to Batteries? https://bugzilla.redhat.com/show_bug.cgi?id=466168
valross has quit ["Ex-Chat"]
<Yoric[DT]> rwmjones: eventually.
<Yoric[DT]> For the moment, I have strictly 0 time to work on Batteries, so you should ask thelema.
<rwmjones> ok
<Yoric[DT]> (essentially, he's in charge now)
verte has quit ["~~~ Crash in JIT!"]
ikaros has quit ["Leave the magic to Houdini"]
<rwmjones> _zack, 1.1, fine .. I didn't realize there was anything significant to release
<rwmjones> Yoric[DT], I tell you what would be nice, if it defaulted to using rlwrap or readline
<rwmjones> Yoric[DT], but anyway, I finally got batteries to run on fedora, so I'll submit a review request
<Yoric[DT]> Great.
<Yoric[DT]> I'd love to see Batteries in Fedora :)
<_zack> rwmjones: ack
<_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, http://fpaste.org/JKkg/
<thelema> rwmjones: is that just for fedora?
<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, the name DESTDIR is reserved for package installations, see: http://www.gnu.org/prep/standards/html_node/DESTDIR.html
<thelema> rwmjones: ok, I'll change that name
<rwmjones> homework time already?
<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)
<thelema> flux: ;; inside guessing_game?
<flux> thelema, no
<flux> argh, I misread his question
<flux> but what he wants is to use parens and ;
<_unK> hmm
<_unK> http://codepad.org/oiiMfOmt with ; it doesn't work. I guess something is wrong here?
<flux> parenthesis
<flux> if num > n then ( info .. ; guessing_game n )
<_unK> ah
<_unK> thx
<thelema> yes, you need begin/end or () with if/then/else to use ;
<Camarade_Tux> otherwise ocaml think the end of the "then" block happens to early (at your first ';')
<thelema> I went back and forth with the ocaml gods on this, and they're of the opposite opinion that () is needed.
<flux> what?
ofaurax has joined #ocaml
f[x] has quit [Read error: 145 (Connection timed out)]
<thelema> for [if then else], at the moment, some sort of grouping is needed
<thelema> because it assumes ; ends the if/then
<thelema> but the construct "if foo then let x = blah in bar1; bar2 else baz" groups properly
<thelema> time to go home, will continue this conversation later if interesting.
<hcarty> thelema: That is rather strange.
<hcarty> It seems to work for the "else" portion as well.
<hcarty> IIRC, this is one of the ambiguities the revised syntax is/was meant to address.
itewsh has joined #ocaml
Cay has joined #ocaml
Cay has left #ocaml []
albacker has quit ["Leaving"]
itewsh has quit [Remote closed the connection]
spaceBARbarian has joined #ocaml
tmaeda is now known as tmaedaZ
valross has joined #ocaml
lutter has quit ["Leaving."]
ikaros has quit ["Leave the magic to Houdini"]
ofaurax has quit ["Leaving"]
thrasibule has quit [Read error: 110 (Connection timed out)]
Narrenschiff has quit []
smimram has quit ["bli"]
jzmer has joined #ocaml
kaustuv_ has joined #ocaml
chahibi_ has quit [Read error: 60 (Operation timed out)]
chahibi has joined #ocaml
kaustuv_` has quit [Read error: 110 (Connection timed out)]
spaceBARbarian has quit ["Leaving"]