watermind has quit [Quit: Konversation terminated!]
watermind has joined #ocaml
watermind has quit [Client Quit]
watermind has joined #ocaml
nikki93 has quit [Remote host closed the connection]
kyrylo_ has joined #ocaml
bicgena has joined #ocaml
nisstyre has quit [Quit: Leaving]
nisstyre has joined #ocaml
ygrek has joined #ocaml
zpe has joined #ocaml
lostcuaz has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
avsm has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
avsm has quit [Ping timeout: 264 seconds]
oriba has quit [Quit: oriba]
talzeus_ has joined #ocaml
talzeus__ has joined #ocaml
kyrylo has quit [Ping timeout: 260 seconds]
caseyjames has quit [Ping timeout: 272 seconds]
talzeus_ has quit [Ping timeout: 245 seconds]
ollehar has quit [Ping timeout: 245 seconds]
introom has joined #ocaml
ygrek has joined #ocaml
kyrylo_ has quit [Ping timeout: 245 seconds]
WraithM has joined #ocaml
zpe has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
shinnya has joined #ocaml
Eyyub has quit [Read error: Operation timed out]
Eyyub has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
Myk267 has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
wolfnn has quit [Ping timeout: 272 seconds]
zpe has joined #ocaml
Eyyub has quit [Ping timeout: 264 seconds]
zpe has quit [Ping timeout: 252 seconds]
jao has quit [Ping timeout: 246 seconds]
gereedy has quit [Ping timeout: 240 seconds]
tizoc has quit [Ping timeout: 272 seconds]
gereedy has joined #ocaml
tizoc has joined #ocaml
Simn has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnm_ has joined #ocaml
dnm has quit [Ping timeout: 272 seconds]
ygrek has quit [Ping timeout: 272 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
nikki93 has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest37912
Guest37912 has quit [Remote host closed the connection]
Kakadu has joined #ocaml
nisstyre has quit [Quit: Leaving]
zpe has joined #ocaml
ski_ has quit [Quit: Lost terminal]
zpe has quit [Ping timeout: 272 seconds]
avsm has joined #ocaml
avsm has quit [Ping timeout: 272 seconds]
dnm_ has quit [Ping timeout: 245 seconds]
Eyyub has joined #ocaml
zpe has joined #ocaml
mort___ has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
Eyyub has quit [Ping timeout: 272 seconds]
mort___ has quit [Quit: Leaving.]
Snark has joined #ocaml
axiles has joined #ocaml
avsm has joined #ocaml
xkb_ has joined #ocaml
avsm has quit [Ping timeout: 260 seconds]
nikki93 has quit [Remote host closed the connection]
xkb_ is now known as xkb
dant3 has joined #ocaml
qrada has joined #ocaml
Simn has quit [Ping timeout: 245 seconds]
nikki93 has joined #ocaml
thomasga has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
pango has quit [Ping timeout: 260 seconds]
pango has joined #ocaml
jbrown has joined #ocaml
rand000 has joined #ocaml
pminten has joined #ocaml
Simn has joined #ocaml
ulfdoz has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
avsm has joined #ocaml
mort___ has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
avsm has joined #ocaml
kyrylo has joined #ocaml
nikki93 has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
avsm has quit [Client Quit]
rand000 has quit [Ping timeout: 260 seconds]
rand000 has joined #ocaml
nikki93 has joined #ocaml
avsm has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
thomasga has quit [Quit: Leaving.]
nikki93 has quit [Remote host closed the connection]
Zerker has joined #ocaml
thomasga has joined #ocaml
zpe has joined #ocaml
ollehar has joined #ocaml
watermind has joined #ocaml
csakatoku has joined #ocaml
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 272 seconds]
thomasga has quit [Quit: Leaving.]
mort___ has quit [Quit: Leaving.]
rand000 has quit [Quit: leaving]
Simn has quit [Ping timeout: 264 seconds]
darkf has quit [Quit: Leaving]
csakatok_ has quit [Remote host closed the connection]
pminten has quit [Quit: Leaving]
jonludlam has joined #ocaml
nikki93 has joined #ocaml
jonludlam has quit [Client Quit]
Zerker has quit [Remote host closed the connection]
Zerker has joined #ocaml
dant3 has quit [Remote host closed the connection]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
oriba has joined #ocaml
wolfnn has joined #ocaml
Zerker has quit [Quit: Colloquy for iPad - Timeout (10 minutes)]
kyrylo has quit [Ping timeout: 245 seconds]
mort___ has joined #ocaml
bobry_ has quit [*.net *.split]
emmanueloga has quit [*.net *.split]
dch has quit [*.net *.split]
jzelinskie has quit [*.net *.split]
esden has quit [*.net *.split]
esden has joined #ocaml
bobry_ has joined #ocaml
jzelinskie has joined #ocaml
dch has joined #ocaml
emmanueloga has joined #ocaml
bicgena has quit [Ping timeout: 245 seconds]
Eyyub has joined #ocaml
ollehar has quit [Ping timeout: 265 seconds]
bicgena has joined #ocaml
ollehar has joined #ocaml
kyrylo has joined #ocaml
carm has quit [Ping timeout: 272 seconds]
watermind has quit [Quit: Konversation terminated!]
ggole has joined #ocaml
watermind has joined #ocaml
watermind has quit [Client Quit]
watermind has joined #ocaml
watermind has quit [Remote host closed the connection]
watermind has joined #ocaml
pminten has joined #ocaml
Eyyub has quit [Ping timeout: 260 seconds]
NaCl has quit [Ping timeout: 246 seconds]
NaCl has joined #ocaml
NaCl has quit [Changing host]
NaCl has joined #ocaml
mort___ has quit [Quit: Leaving.]
Anarchos has joined #ocaml
Simn has joined #ocaml
wwilly has joined #ocaml
<oriba>
How would you implement a protocol, say SMTP or IMAP and use the type-system for helping you here? Sum types? Polymorphic variants? GADTs? is there something best suited for protocol implementation?
<flux>
I've found an approach where requests are first class citizens working fine
<flux>
so you have 'a request
<flux>
and a function, like: val list_mails : folder_name -> mail_list request
<flux>
then you have a set of functions: val synchronous_query : connection -> 'a request -> 'a
<flux>
val asynchronous_query : connection -> 'a request -> ('a -> unit) -> unit
<flux>
etc
<flux>
and then a set of functions that can extract information out of those 'a requests
<flux>
in practice it's not much different from having, say, a separate class for each request in Java, so I'm not sure if this satisfies your desire to use fancy features :)
<flux>
but, it's safe, except of course the state (if there is one) of the session is not encoded anywhere
<oriba>
and 'a stands for the results? So, you don't use string representation, but rather header/body/and so on? Does 'a be the result like body/header ando so on?
<flux>
one would probably have type mail = { mail_header : (string * string) list; mail_body : string } somewhere
<oriba>
hmhhh
<flux>
I suppose one could use polymorphic variants for the header
<flux>
but it wouldn't work for all fields
<flux>
one could choose to use them for the 'interesting' fields
<flux>
but as it's not really guaranteed that mostly ANY header is available, I'm not sure if that brings great benefits
<flux>
so you could have type header_entry = [ `From of email_address | `Subject of string | `Other of (string * string) ]
<oriba>
Why wouldn't iut work on all fields?
kizzx2 has joined #ocaml
<flux>
because you cannot know all possible headers up front
<flux>
I can just write anything there :)
<oriba>
Did you implemented SMTP or IMAP this way (or a different protocol)?
<flux>
I have implemented a proprietary request-response protocol this way
<oriba>
aha
<flux>
in particular the responses in that protocol did not need to arrive in-order
<flux>
such as I believe is the case with IMAP
<oriba>
aha, ok
shinnya has quit [Ping timeout: 272 seconds]
nikki93 has quit []
mort___ has joined #ocaml
pminten has quit [Remote host closed the connection]
dant3 has joined #ocaml
mort___ has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]
ollehar1 has joined #ocaml
tane has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
mcclurmc has joined #ocaml
ulfdoz has joined #ocaml
dant3 has quit [Remote host closed the connection]
mort___ has joined #ocaml
dant3 has joined #ocaml
dant3_ has joined #ocaml
dant3 has quit [Ping timeout: 272 seconds]
Anarchos has quit [Quit: rebooting to reinstall]
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
introom has quit [Ping timeout: 272 seconds]
talzeus__ has quit [Read error: Connection reset by peer]
jbrown has quit [Remote host closed the connection]
leifw has joined #ocaml
zxqdms has quit [Read error: Operation timed out]
Myk267 has quit [Quit: Myk267]
skchrko has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
skchrko has quit [Client Quit]
kyrylo has quit [Ping timeout: 264 seconds]
Anarchos has joined #ocaml
sillyotter has joined #ocaml
sillyotter has quit [Remote host closed the connection]
avsm has joined #ocaml
kyrylo has joined #ocaml
mort___ has quit [Quit: Leaving.]
lostcuaz has joined #ocaml
mfp_ has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
arjunguha has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mort___ has joined #ocaml
mfp_ has joined #ocaml
skchrko has joined #ocaml
pango has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-280704]: i've been blurred!]
kyrylo has quit [Ping timeout: 272 seconds]
pango has joined #ocaml
pango has quit [Client Quit]
mort___ has quit [Quit: Leaving.]
pango has joined #ocaml
lostcuaz has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
arj has joined #ocaml
mort___ has joined #ocaml
sheijk has joined #ocaml
dant3_ has quit [Remote host closed the connection]
ggole has quit []
oriba has quit [Quit: oriba]
leifw has quit [Ping timeout: 240 seconds]
leifw has joined #ocaml
mort___ has quit [Quit: Leaving.]
tane has quit [Quit: Verlassend]
mort___ has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest82572
kizzx2 has quit [Quit: Leaving.]
jbrown has joined #ocaml
zzz_` has joined #ocaml
j0sh__ has joined #ocaml
rixed_ has joined #ocaml
bacam_ has joined #ocaml
yroeht1 has joined #ocaml
MigX has joined #ocaml
j0sh has quit [Ping timeout: 246 seconds]
mrvn_ has joined #ocaml
mfp__ has joined #ocaml
yroeht has quit [Ping timeout: 246 seconds]
ohama has quit [Ping timeout: 246 seconds]
cthuluh has quit [Ping timeout: 246 seconds]
rks` has quit [Ping timeout: 246 seconds]
zzz_ has quit [Ping timeout: 246 seconds]
fayden has quit [Ping timeout: 246 seconds]
rixed has quit [Ping timeout: 246 seconds]
bacam has quit [Ping timeout: 246 seconds]
thorsten` has quit [Ping timeout: 246 seconds]
cthuluh has joined #ocaml
vbmithr_ has joined #ocaml
Guest82572 has quit [Remote host closed the connection]
julm_ has joined #ocaml
mort___ has left #ocaml []
arjunguh_ has joined #ocaml
ohama has joined #ocaml
rks` has joined #ocaml
thorsten` has joined #ocaml
mfp_ has quit [Read error: Connection reset by peer]
zarul has quit [Ping timeout: 246 seconds]
MiggyX has quit [Ping timeout: 246 seconds]
vbmithr has quit [Ping timeout: 246 seconds]
julm has quit [Ping timeout: 246 seconds]
mrvn has quit [Ping timeout: 246 seconds]
7CBAANTLS has joined #ocaml
7CBAANTLS has quit [*.net *.split]
arjunguha has quit [*.net *.split]
julm_ is now known as julm
zarul has joined #ocaml
zarul has quit [Max SendQ exceeded]
zarul has joined #ocaml
fayden has joined #ocaml
NoNNaN has left #ocaml []
ollehar1 has quit [Ping timeout: 245 seconds]
sheijk_ has joined #ocaml
nicoo_ has joined #ocaml
cthuluh_ has joined #ocaml
bacam has joined #ocaml
jbrown has quit [Ping timeout: 260 seconds]
cdidd has quit [Ping timeout: 260 seconds]
ulfdoz has quit [Ping timeout: 260 seconds]
mrvn_ has quit [Ping timeout: 260 seconds]
hellome has quit [Ping timeout: 260 seconds]
ddosia has quit [Ping timeout: 260 seconds]
bacam_ has quit [Ping timeout: 248 seconds]
nicoo has quit [Ping timeout: 248 seconds]
yroeht1 has quit [Ping timeout: 248 seconds]
cthuluh has quit [Disconnected by services]
cthuluh_ is now known as cthuluh
leifw has quit [*.net *.split]
sheijk has quit [*.net *.split]
bicgena has quit [*.net *.split]
bobry_ has quit [*.net *.split]
gereedy has quit [*.net *.split]
demonimin has quit [*.net *.split]
teiresias has quit [*.net *.split]
divyansr_ has quit [*.net *.split]
PM has quit [*.net *.split]
lopex has quit [*.net *.split]
bitbckt has quit [*.net *.split]
robink has quit [*.net *.split]
<companion_cube>
gasche: are you here?
mrvn has joined #ocaml
ddosia1 has joined #ocaml
yroeht1 has joined #ocaml
ulfdoz_ has joined #ocaml
|jbrown| has joined #ocaml
robink has joined #ocaml
fayden has quit [*.net *.split]
zarul has quit [*.net *.split]
<adrien>
gasche: btw, thinking about it, it's to /r/linux that you should have posted the link to dmlenu, not so much /r/ocaml; not saying it's bad but I think that's something we don't do enough
ulfdoz_ is now known as ulfdoz
cdidd has joined #ocaml
<companion_cube>
I need someone with admin access to batteries' github repo :)
fayden has joined #ocaml
zarul has joined #ocaml
<rks`>
adrien: I'm not sure people on /r/linux would be interested by an ocaml library
hnrgrgr has joined #ocaml
zarul has quit [Max SendQ exceeded]
zarul has joined #ocaml
zarul has quit [Ping timeout: 260 seconds]
zarul has joined #ocaml
tov_ has joined #ocaml
metasyntax` has joined #ocaml
<adrien>
well, you have an executable too
jave_ has joined #ocaml
bjorkbsd has joined #ocaml
julm_ has joined #ocaml
metasyntax has quit [Read error: Operation timed out]
jave has quit [Read error: Operation timed out]
hnrgrgr_ has quit [Read error: Operation timed out]
tov has quit [Read error: Operation timed out]
julm has quit [Ping timeout: 265 seconds]
bjorkintosh has quit [Ping timeout: 265 seconds]
zarul has quit [Changing host]
zarul has joined #ocaml
rixed has joined #ocaml
clog has joined #ocaml
kyrylo has joined #ocaml
zenspider has joined #ocaml
lopex has joined #ocaml
kyrylo_ has joined #ocaml
kyrylo has quit [Remote host closed the connection]
darkf has joined #ocaml
WraithM_ has joined #ocaml
wwilly has quit [Quit: Leaving]
kyrylo_ has quit [Ping timeout: 264 seconds]
WraithM_ has quit [Ping timeout: 245 seconds]
Thooms has quit [Ping timeout: 260 seconds]
teiresias has joined #ocaml
kyrylo has joined #ocaml
Myk267 has joined #ocaml
arj has quit [Quit: Leaving.]
ulfdoz has quit [Ping timeout: 276 seconds]
<dRbiG>
is there any way to make a map/hash table from a literal?
<Drup>
hash table is probably easier to use, Map is based on research trees and may be a bit more complicated for a beginner.
<dRbiG>
right now i'm trying to get something to work - i have this (quite a long standing) tradition of trying to implement x in language y just to see how i feel with language y
<dRbiG>
so sorry for silly question :)
<Drup>
so, what is X ? :)
<Drup>
if it's just "using an hashtbl", then go for the last link
<orbitz>
what are 'research trees'?
<dRbiG>
i guess i'll paste it
<orbitz>
dRbiG: Ocaml does not have map/hash literals. You can easily write a function to take a list of tuples and make a Map
<dRbiG>
so i'll go around and try to figure it own on my onw
<dRbiG>
own*
<orbitz>
You don't need a map really for this
<orbitz>
i'd just use a list of tuples as a map
vpm has left #ocaml []
<dRbiG>
i did it the tutorial-dumb version, which is not a problem, as my problem is that printf "[%i] %s\n" i (MacTab.find Sys.argv.(i) mt) doesn't work; any my first assumption is that i'm not handling the case where there is no such key