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>
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