dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | 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/
jcreigh has quit ["Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet."]
mnemonic has joined #ocaml
<mnemonic> hi
Revision17 has quit [Read error: 110 (Connection timed out)]
Revision17 has joined #ocaml
rillig has quit ["exit(EXIT_SUCCESS)"]
shekmalhen has quit ["yeeeehaaa!"]
shekmalhen has joined #ocaml
mnemonic has quit [Read error: 110 (Connection timed out)]
cayl has quit ["My damn controlling terminal disappeared!"]
sponge45 has joined #ocaml
shekmalhen has quit ["leaving"]
shekmalhen has joined #ocaml
shekmalhen has quit ["bonne nuit"]
Smerdyakov has quit ["Leaving"]
khaladan_ has joined #ocaml
finelemon has joined #ocaml
khaladan has quit [Success]
khaladan_ is now known as khaladan
dark_light has quit [No route to host]
sponge45 has quit ["zzzzzzzz"]
_jol_ has joined #ocaml
_jol_ has quit ["leaving"]
smimou has joined #ocaml
mnemonic has joined #ocaml
<mnemonic> hi
love-pingoo has joined #ocaml
_jol_ has joined #ocaml
love-pingoo has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
cayl has joined #ocaml
<cayl> bot
<zmdkrbou> top
<gim> hi krbou ^^
<zmdkrbou> yo gim
Smerdyakov has joined #ocaml
dark_light has joined #ocaml
dark_light has quit [Read error: 104 (Connection reset by peer)]
_jol_ has quit ["leaving"]
Schmurtz has quit ["L'énergie semble manquer : dodo !"]
_jol_ has joined #ocaml
_jol_ has quit ["leaving"]
_jol_ has joined #ocaml
mnemonic has quit ["leaving"]
Smerdyakov has quit ["Leaving"]
_jol_ has quit ["leaving"]
rillig has joined #ocaml
dash has joined #ocaml
<dash> hi
<dash> anyone around? i'm trying to understand ocaml's typesystem by porting some code from python :)
smimou has quit [Read error: 110 (Connection timed out)]
<dash> in particular, a control structure
<zmdkrbou> ouhla, from python to ocaml ... :)
<zmdkrbou> dash: so what's your problem more precisely ?
<dash> well, i have a class in python, named Deferred
<dash> it has two public methods, addCallback and callback
<dash> addCallback takes a function of one argument
<dash> callback takes a value
<dash> it keeps a list internally of callback functions, and when Deferred.callback is called with a value, it calls the first function in the list, then calls the second function in the list with its return value, etc
<zmdkrbou> looks like a fold
<dash> also if any of the callback functions return a Deferred, the remaining callbacks are appended to the callback list of the returned Deferred.
<dash> so in practice it looks like this
<dash> d = Deferred()
<dash> d.addCallback(convert_to_string); d.addCallback(wait_for_more_data); d.addCallback(print_on_stdout)
<dash> d.callback(someValue)
<dash> this can't be done in ocaml the same way of course
<dash> since the function types are 'a -> 'b, 'b -> 'c, ... 'x -> 'y
<dash> so they can't just be kept in a list
<zmdkrbou> if you want to treat *any* value yes
<zmdkrbou> but the problem is in the very idea of doing this, it's against strong typing ...
<dash> why so?
<zmdkrbou> because you want to treat any possible input without distinctions
<dash> hmm
<dash> well let me back up and explain why i want this, and perhaps you can tell me a better way to do it.
<dash> in python, I use this for event-driven programming
<dash> when I have a function that needs to do something after some event happens (say, more data arrives from the network), it usually creates a Deferred and attaches the rest of its work to it as a callback
<dash> and returns it
<dash> and then anything that depends on the final value from that function can attach more callbacks, etc
<dash> this way there's a generic mechanism for connecting together parts of an event driven program rather than having random callback fields everywhere
<dash> so in a certain sense, it's a reified call stack
finelemo1 has joined #ocaml
flux__ has joined #ocaml
finelemon has quit [Read error: 110 (Connection timed out)]
finelemo1 has quit [Read error: 110 (Connection timed out)]
finelemon has joined #ocaml
Smerdyakov has joined #ocaml
shekmalhen has joined #ocaml
shekmalhen has quit ["bah"]
AI_coder has joined #ocaml
AI_coder has quit [Remote closed the connection]
hcarty has joined #ocaml
asbeta has joined #ocaml
_jol_ has joined #ocaml
sponge45 has joined #ocaml
<_jol_> hello everyone, ocamlc gives me a strange error message
<_jol_> could someone help me with this ?
<asbeta> probably you have two different declarations with the same name
<_jol_> my .mli file is generated by ocamlc -i, so I believe they are identical....
<_jol_> ha, i've found it
<_jol_> renaming my in_channel to inchannel worked.
<_jol_> asbeta: you were right, i guess that the built-in in_channel type conflicted with my class.
<asbeta> ok :)
cayl has quit ["."]
nealc has joined #ocaml
descender has joined #ocaml
jcreigh has joined #ocaml
_jol_ has quit [""mi tatpi .i co'o rodo""]
Revision17 has quit ["Ex-Chat"]
sponge45 has left #ocaml []
smimou has joined #ocaml
rillig has quit ["exit(EXIT_SUCCESS)"]
rillig has joined #ocaml
tristram has quit [Read error: 110 (Connection timed out)]
jcreigh has quit ["Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet."]
mwc has joined #ocaml
sponge45 has joined #ocaml
mwc has quit ["Leaving"]
smimou has quit ["bli"]
Revision17 has joined #ocaml