Banana changed the topic of #ocaml to: OCaml 3.08.1 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
Naked has joined #ocaml
Naked is now known as Hadaka
CosmicRay has joined #ocaml
enthalpyX has joined #ocaml
cmeme has quit [zelazny.freenode.net irc.freenode.net]
cmeme has joined #ocaml
cmeme has quit [Broken pipe]
cmeme has joined #ocaml
docelic has joined #ocaml
mfurr has joined #ocaml
CosmicRay has quit ["Leaving"]
mfurr has quit ["Leaving"]
ofranja has quit ["leaving"]
GreyLensman has quit ["Leaving"]
tnks has joined #ocaml
kinners has joined #ocaml
cjohnson has quit ["The main attraction: distraction"]
kinners has quit ["leaving"]
haakonn_ has joined #ocaml
haakonn has quit [Read error: 113 (No route to host)]
dan2 has quit [Read error: 60 (Operation timed out)]
mrsolo_ has joined #ocaml
haakonn_ has quit [Read error: 113 (No route to host)]
<vincenz> How do you make cyclic tpes?
<vincenz> types
enthalpyX has left #ocaml []
<vincenz> (basically, how would I implement a trie?)
haakonn has joined #ocaml
Herrchen has joined #ocaml
Submarine has joined #ocaml
<det> a trie is a cyclic type?
<det> What type do you think it has?
<Submarine> a trie?
<Submarine> depends on how you implement it
<Herrchen> what do you mean with cyclic? the type itself or the resulting datastructures?
<Submarine> type 'a trie = boolean * ('a * 'a trie) list
<Herrchen> because the datastructure has to be acyclic, because it is a tree which is of course acyclic
<Herrchen> maybe insert the current prefix in the trie node, could make life easier
velco has joined #ocaml
<pango> $ ocaml -rectypes
<pango> # type ('a, 'b) trie = 'a * ('b * ('a, 'b) trie) list ;;
mlh has quit [Client Quit]
<Herrchen> try something like "type ('a, 'b) trie = Leaf of 'a | Node of 'a * ('b * ('a, 'b) trie) list"
<Herrchen> then you don't need to specify -rectypes
<pango> yes
<Submarine> IMHO, you should use a Map instead of a list
<Submarine> this is possible with recursive modules
Submarine has quit ["ChatZilla 0.8.31 [Mozilla rv:1.4.1/20031114]"]
pango has quit ["bbl"]
pango has joined #ocaml
ez4 has quit ["Quitting!"]
<Herrchen> or instead of a list, use an array, if your alphabet is fixed size and not too big, compared to the number of elements you want to store in the tree
vezenchio has joined #ocaml
<vincenz> hmm
<vincenz> well the most easiest thing is
<vincenz> type 'a trie = 'a trie Map.t
<vincenz> (with some Map)
<vincenz> I'll use Some vs None
mrsolo_ has quit [Read error: 238 (Connection timed out)]
mlh has joined #ocaml
m3ga has joined #ocaml
m3ga has quit [Client Quit]
dan2 has joined #ocaml
dan2 has quit [Read error: 110 (Connection timed out)]
haakonn_ has joined #ocaml
haakonn has quit [Read error: 110 (Connection timed out)]
lmbdwar has joined #ocaml
<lmbdwar> 'lut
haakonn has joined #ocaml
haakonn_ has quit [Read error: 110 (Connection timed out)]
melchus has joined #ocaml
mlh has quit [Client Quit]
srv has quit [Read error: 232 (Connection reset by peer)]
cjohnson has joined #ocaml
srv has joined #ocaml
docelic has quit ["Quit"]
pflanze has joined #ocaml
CosmicRay has joined #ocaml
ez4 has joined #ocaml
cmeme has quit [Broken pipe]
eugos has joined #ocaml
cmeme has joined #ocaml
arty has joined #ocaml
lmbdwar has left #ocaml []
velco has quit [Read error: 110 (Connection timed out)]
eugos has quit ["Leaving"]
eugos has joined #ocaml
arty has quit [Remote closed the connection]
arty has joined #ocaml
Bababa has joined #ocaml
<Bababa> hello
<Bababa> i'm looking for the book "Purely Functional Data Structures" by Chris Okasaki in an electronic form. i searched all bookshops/libraries etc., without success. does any of you have that book in .pdf or something ?
<eugos> Bababa, the first link in Google by keywords:
<eugos> "Purely Functional Data Structures" pdf
<Bababa> this is not the book, but the guys thesis
<Bababa> actually 1/3 of that thesis
<eugos> Bababa, :(
<Bababa> yup, though luck
<Bababa> ;]
<eugos> Bababa, partially :)
<haakonn> you could perhaps try to find some of it at print.google.com (nice before you buy)
<Bababa> i would buy it if was available
<haakonn> it's out of print?
<Bababa> well i don't know if it's ever been printed in my country ;]
<haakonn> oh, but you can get it from many online bookstores, i've seen it at amazon
<haakonn> http://print.google.com/print?id=SxPzSTcTalAC&prev=http://print.google.com/print%3Fq%3Dpurely%2Bfunctional%2Bdata%2Bstructures&pg=1&sig=1CZOLdf-rWp19g79ireuWC2hr5c <-- some pages from it
<Bababa> 40$ for a book is a lot ;] i want to try other ways before i go for amazon ;]
<Bababa> and obviously there's a problem with the credit card ;]
velco has joined #ocaml
pango has quit ["brb"]
<Bababa> ok, thx anyway
<Bababa> bye
Bababa has left #ocaml []
pango has joined #ocaml
mamlmirc has joined #ocaml
<mamlmirc> hello
mamlmirc is now known as maml
mattam has joined #ocaml
mattam has quit [Client Quit]
<maml> I have a module A define like this : module A (K: OrderedInt) = struct (** ... **) end
mattam has joined #ocaml
<maml> I'd like to use the module "Set.Make (K)" in the def of this module.
<maml> is it possible ?
Submarine has joined #ocaml
<maml> i've big problems with english grammar, excuse me if i'm ununderstable.
cjohnson has quit [Read error: 54 (Connection reset by peer)]
pflanze has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
gpciceri has joined #ocaml
<mattam> "open Set.Make (K)" in your module
_fab has quit [Remote closed the connection]
<Smerdyakov> I don't like that so much. You have no way to name the module, if you need to do so to disambiguate.
salo has joined #ocaml
<salo> type 'state state = State of 'state | Startup;;
<salo> let f x = match x with Startup ->
<salo> begin
<salo> print_endline "starting up";
<salo> 0;
<salo> end
<salo> | State x -> x + 1;;
<haakonn> don't need ; after 0
<salo> why doesn't "f 0" work as i expect?
<salo> i expect "f 0" to yield 1
<haakonn> because 0 has type int, not int state
<salo> it appears i need to explicity create a value of type "int State" but i dunno how
<avlondono> f (State 0)
<haakonn> f (State 0) works
<salo> yay! thanks! another obstacle overcome
<Smerdyakov> salo, are you sure you've read a tutorial closely enough?
<avlondono> read the manual, this is not an obstacle
<salo> what can i say? i read it, i have questions, i ask them ... and nice people help out
<Smerdyakov> I don't believe that you've read it carefully, if you have questions like that.
<avlondono> at least, after having a working example go and read the manual, it will make more sense and you'll truly learn the language.
<haakonn> having a java background, i found http://www.merjis.com/developers/ocaml_tutorial/ extremely useful
<salo> like i said, i've read everything i could find. you don't want me to listen to me ask for help, i suppose you can ignore me
<avlondono> nobody said that salo
<haakonn> salo: ask if you want, i'll gladly help when i'm available
<avlondono> but you'll not do things well in this way. it's a good advice. and what you suggest is widely done in irc anyway.
<salo> haakonn: thanks!
* salo goes back to learning
salo has quit []
<Smerdyakov> salo, you should also interpret what I'm saying as a suggestion that you are using a very poor learning strategy. I believe that you must be "skimming," not "reading," the manual, and that that is not a good way to learn.
<haakonn> d'oh
<avlondono> there you have. I never understand this.
<avlondono> Smerdyakov is spending more time explaining him that this is not a good way than simply answering the stupid question.
<Smerdyakov> salo, I've been a teaching assistant for an ML class, and I don't think anyone ever asked a question like yours. It just doesn't come up if you follow the exposition of the material.
<avlondono> he is not here anymor Smerdyakov
<haakonn> Smerdyakov: he left
<Smerdyakov> I see.
<haakonn> i've been an assistant for an ML class too, and they all asked questions exactly like that (interpreting typing error messages)
<haakonn> but i can almost understand it, SML errors are a lot harder to read than ocaml's
* Smerdyakov laughs.
<Smerdyakov> I find it to be the other way around.
<haakonn> for a trained eye, sml errors are more _precise_, yes
<Submarine> You are a lucky person: I program in OCaml, but I've been teaching Java for 5 years.
<haakonn> hehe
Tahir007 has joined #ocaml
<Niccolo> i'm learning ocaml... it has lazy evaluation, right?
<pango> yes, but it's not the default evaluation strategy
<Niccolo> ok
<Niccolo> so you can "turn it on" when needed then?
<Niccolo> ah. thanks.
Tahir007 has quit []
<pango> http://www.google.fr/search?q=cache:PjTpvRiBnd0J:www.bagley.org/~doug/ocaml/Notes/lazy.shtml
<Submarine> lazy evaluation may be simulated in eager languages by judicious use of eta-expansion and splitting
shawn_ has quit [Read error: 54 (Connection reset by peer)]
_shawn has joined #ocaml
limi|bigbutts has joined #ocaml
limi|bigbutts has quit [Remote closed the connection]
gpciceri has quit ["Ciao, sono un virus dei messaggi di quit. Sostituisci la tua vecchia linea di quit con questa cosi potro continuare a moltipl]
vezenchio has quit ["None of you understand. I'm not locked up in here with you. YOU are locked up in here with ME!"]
Submarine has quit [Remote closed the connection]
eugos has quit ["Leaving"]
velco has quit ["I'm outta here ..."]
CosmicRay has quit ["Client exiting"]
Nutssh has joined #ocaml
m3ga has joined #ocaml