gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
bitbckt has quit [*.net *.split]
emmanuelux has quit [*.net *.split]
dcolish has quit [*.net *.split]
chambart has quit [*.net *.split]
junsuijin has quit [*.net *.split]
sgnb has quit [*.net *.split]
zorun has quit [*.net *.split]
noj has quit [*.net *.split]
Lor has quit [*.net *.split]
fabjan has quit [*.net *.split]
Tobu has quit [*.net *.split]
jlouis has quit [*.net *.split]
rossberg has quit [*.net *.split]
ankit9 has quit [*.net *.split]
shachaf has quit [*.net *.split]
jonafan has quit [*.net *.split]
mattam has quit [*.net *.split]
snarkyboojum has quit [*.net *.split]
Tianon has quit [*.net *.split]
milosn has quit [*.net *.split]
flux has quit [*.net *.split]
wishi has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
wagle has quit [*.net *.split]
raphael-p has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
brendan has quit [*.net *.split]
Pepe_ has quit [*.net *.split]
malouin has quit [*.net *.split]
rby has quit [*.net *.split]
haelix has quit [*.net *.split]
lopex has quit [*.net *.split]
f[x] has quit [*.net *.split]
bobry has quit [*.net *.split]
wormphlegm has quit [*.net *.split]
bacam has quit [*.net *.split]
nimred has quit [*.net *.split]
TaXules has quit [*.net *.split]
rks has quit [*.net *.split]
zmoazeni has quit [*.net *.split]
everyonemines has quit [*.net *.split]
deavid has quit [*.net *.split]
rwmjones has quit [*.net *.split]
caligula has quit [*.net *.split]
diml has quit [*.net *.split]
svenl has quit [*.net *.split]
joewilliams is now known as joewilliams_away
sebz has joined #ocaml
bitbckt has joined #ocaml
emmanuelux has joined #ocaml
Tianon has joined #ocaml
dcolish has joined #ocaml
rks has joined #ocaml
lopex has joined #ocaml
chambart has joined #ocaml
junsuijin has joined #ocaml
milosn has joined #ocaml
everyonemines has joined #ocaml
sgnb has joined #ocaml
f[x] has joined #ocaml
ankit9 has joined #ocaml
flux has joined #ocaml
zorun has joined #ocaml
bobry has joined #ocaml
wishi has joined #ocaml
hyperboreean has joined #ocaml
shachaf has joined #ocaml
wagle has joined #ocaml
rossberg has joined #ocaml
jlouis has joined #ocaml
Tobu has joined #ocaml
fabjan has joined #ocaml
Lor has joined #ocaml
noj has joined #ocaml
jonafan has joined #ocaml
caligula has joined #ocaml
wormphlegm has joined #ocaml
mattam has joined #ocaml
snarkyboojum has joined #ocaml
zmoazeni has joined #ocaml
bacam has joined #ocaml
nimred has joined #ocaml
TaXules has joined #ocaml
deavid has joined #ocaml
rwmjones has joined #ocaml
haelix has joined #ocaml
rby has joined #ocaml
malouin has joined #ocaml
Pepe_ has joined #ocaml
brendan has joined #ocaml
Asmadeus has joined #ocaml
raphael-p has joined #ocaml
svenl has joined #ocaml
diml has joined #ocaml
srcerer has quit [Ping timeout: 241 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
lopex has quit []
emmanuelux has quit [Ping timeout: 244 seconds]
frankl_ has joined #ocaml
frankl_ has quit [Client Quit]
frankl_ has joined #ocaml
frankl_ has quit [Client Quit]
frankl_ has joined #ocaml
frankl_ has quit [Quit: Leaving]
Boscop has quit [Ping timeout: 252 seconds]
Boscop has joined #ocaml
Boscop has quit [Ping timeout: 248 seconds]
everyonemines has quit [Quit: Leaving.]
everyonemines has joined #ocaml
everyonemines has quit [Client Quit]
__marius__ has joined #ocaml
__marius__ has quit [Remote host closed the connection]
__marius__ has joined #ocaml
arubin has quit [Quit: arubin]
joewilliams_away is now known as joewilliams
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
ulfdoz has quit [Ping timeout: 255 seconds]
junsuijin has quit [Quit: Leaving.]
joewilliams is now known as joewilliams_away
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Client Quit]
joewilliams_away is now known as joewilliams
sebz has joined #ocaml
bitbckt has quit [Ping timeout: 244 seconds]
bitbckt has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
Snark has joined #ocaml
joewilliams is now known as joewilliams_away
thomasga has joined #ocaml
sebz has joined #ocaml
larhat has joined #ocaml
edwin has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
ttamttam has joined #ocaml
Lor has quit [Remote host closed the connection]
avsm has joined #ocaml
<f[x]> hcarty, yes, this is the way I've discovered, except that it has to be 'a. 'a T.t -> unit for some reason
<f[x]> but this is not very pretty, cause record is exposed in api - it cannot be abstracted
<f[x]> I expected 3.12 explicit universal polymorphism annotation to work, but it doesn't even parse - let apply t (f : 'a. 'a T.t -> unit) =
<f[x]> thanks anyway!
bobry has quit [Quit: Leaving.]
bitbckt has quit [Quit: out]
Kakadu has joined #ocaml
everyonemines has joined #ocaml
avsm has quit [Quit: Leaving.]
bitbckt has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
avsm has joined #ocaml
asmanur has joined #ocaml
asmanur_ has quit [Ping timeout: 260 seconds]
ikaros has joined #ocaml
rwmjones has quit [Ping timeout: 256 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
rwmjones has joined #ocaml
sebz has joined #ocaml
ttamttam has quit [Quit: ttamttam]
Skolem has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<edwin> hmm ocamlbuild silences syntax errors when computing dependencies
<edwin> it calls ocamlfind ocamldep -pp camlp4r, which shows an error, but all I get when running ocamlbuild is that it exited with code 2
<edwin> and then I have to go to _build and rerun command manually to find out why...
<edwin> are there any workaround for this?
sebz has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit [Read error: Connection reset by peer]
ttamttam has joined #ocaml
emmanuelux has joined #ocaml
ttamttam has quit [Client Quit]
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ttamttam has joined #ocaml
ttamttam has left #ocaml []
ttamttam has joined #ocaml
lopex has joined #ocaml
<f[x]> edwin, maybe -classic-display?
<flux> indeed, it's bloody annoying
<flux> and iirc -classic-display doesn't help
<flux> because it's not compiling at that point
<flux> I think I may have used ocamlbuild -v though to find the erring file
<flux> but it doesn't give out the error position unless I run manually ocamldep in the _build directory
<Skolem> I expect this function to internally raise Not_found and return false, but it doesn't even compile. I get a syntax error at "-> false" saying "This expression should have type unit." What am I doing wrong?
<Skolem> let test () = try for a = 0 to 3 do if a = 2 then raise Not_found done with Not_found -> false; true
<f[x]> is there a bug in mantis on this?
<flux> skolem, so what should it return if it doesn't raise Not_found?
<flux> (the code inside the for loop that is)
<flux> oh, right, you have that there, but it's in the wrong place
<flux> your code is like:
<flux> let test () = (try (for a = 0 to 3 do if a = 2 then raise Not_found done) with Not_found -> (false; true))
<flux> skolem, all branches of a try..with.. must have the same type
_andre has joined #ocaml
seafood has joined #ocaml
bitbckt has quit [Quit: out]
seafood has quit [Quit: seafood]
bitbckt has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
seafood has joined #ocaml
sebz has joined #ocaml
lopex has quit [Ping timeout: 252 seconds]
bitbckt has quit [Quit: out]
<Skolem> Ah.
<Skolem> It's still not clear to me how I'd fix it. I tried changing "done with" to "done; true with" but it didn't help.
<Skolem> I don't really know what a "branch" of a try/with is. I think ther's only one branch of the "with", and it has type bool.
<flux> try branch1 with x -> branch2
<Skolem> How do I make the "try" branch have type bool, I guess is my question.
<flux> so what's your code now?
<Skolem> let is_assoc op set = try for a = 0 to 3 do if a = 2 then raise Not_found done; true with Not_found -> false; true
<Skolem> And I get an error at the same point as before, at "-> false".
<Skolem> ignore the is_assoc op set part... I was trying something else.
<flux> well actually this is indeed the original problem
<flux> but what you solved what a different problem
<flux> what is false; true supposed to do?
<Skolem> Well, it is, except, as I said, I tried changing "done with" to "done; true with". But it didn't help.
<flux> you don't anymore get an error, do you? but a warning?
<Skolem> I was hoping that false;true would actually be two statements. I was hoping that the "false;" would end the try/with block, and if it got past that, it would return true.
<Skolem> I do, I get an error.
<flux> what error?
<flux> I don't get an error from that..
<Skolem> Ha, wait a sec, I may not have saved before re-compiling.
<flux> Warning S: this expression should have type unit.
<flux> val is_assoc : 'a -> 'b -> bool = <fun>
<Skolem> Yes, that's exactly what I get now too.
<flux> but neither of these make sense to me: try .. with x -> (false; true) nor (try .. with x -> false); true
<Skolem> Oh, why doesn't the latter make sense to you?
<flux> in any case, it is being interpreted as the first one
<Skolem> I know that's not a good question, but it makes sense to me and I'm not sure what I'm thinking that's wrong.
<flux> skolem, you make a value and then just ignore it
<Skolem> Oh, I see. The false would never get returned.
<Skolem> Hmm.
<flux> it's like: let foo () = ignore (complicated_expression_returning_something ()); 42
<flux> :)
<Skolem> Yes.
<flux> so that's why it gives a warning
<flux> if the type is 'unit' then it assumes it is done for its side effects
<Skolem> So how do I have the code return one thing if an exception is raised and another thing if one isn't?
<flux> hm, you're doing it already, no?
<flux> just drop the last '; true'
<flux> try do something with x -> (* exception was thrown, do and return something here *) "hello"
<Skolem> Ah, so I am. :)
<Skolem> Awesome, now it's working. I understand better what's going on. Thanks very much.
<flux> no problem. happy hacking :)
seafood has quit [Quit: seafood]
Metapioca has joined #ocaml
Skolem has quit [Quit: Skolem]
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 248 seconds]
bitbckt has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ttamttam has joined #ocaml
mnabil has joined #ocaml
<edwin> flux/f[x]: -classic-display doesn't help. I can see which file the problem is in, I just don't see the error message: ocamlbuild eats it for some reason (3.12.0)
<flux> yeah, that's what I experienced as well
<edwin> is this something new in 3.12.0? I don't remember this much trouble with 3.11
<edwin> or maybe I wrote less syntax errors there :D
<flux> could well be
<f[x]> I am using 3.11 and I didn't notice such behavior, and I am using quite a bit of syntax extensions
<flux> because I have the same feeling
<edwin> happens without syntax extensions too I think
<edwin> semantic errors are fine as those allow ocamldep to move on, and then the error shows up during compilation and it is printed
lopex has joined #ocaml
ttamttam has quit [Quit: ttamttam]
<hcarty> f[x]: I think the record restriction is due to rank-2 polymorphism only being supported through records(?) in OCaml
<hcarty> f[x]: This is the explanation I received when I ran into the same issue
<hcarty> f[x]: It is supported with classes as well according to http://alaska-kamtchatka.blogspot.com/2009/05/rank-2-polymorphism-and-non-uniform.html
<hcarty> I wouldn't be surprised if first class modules opened up something here as well since they can include record types and classes
<f[x]> this is not rank-2 polymorphism
<f[x]> iiuc
<hcarty> f[x]: My understanding of rank-2 polymorphism extends about as far as knowing the name, so I may be way off.
<f[x]> rank-2 is e.g. type 'a t = int 'a with possible members int array, int list, etc
<f[x]> actually I do not know that well too
seafood has joined #ocaml
seafood has quit [Ping timeout: 252 seconds]
<f[x]> hcarty, see the first comment in http://ocaml.janestreet.com/?q=node/79
emmanuelux has quit [Remote host closed the connection]
ttamttam has joined #ocaml
ttamttam has left #ocaml []
emmanuelux has joined #ocaml
ttamttam has joined #ocaml
lopex has quit [Ping timeout: 252 seconds]
lopex has joined #ocaml
lopex has quit []
Boscop has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
larhat1 has joined #ocaml
Kakadu has quit [Quit: Page closed]
benus has joined #ocaml
benus has quit [Remote host closed the connection]
metasyntax|work has joined #ocaml
larhat has joined #ocaml
larhat1 has quit [Read error: No route to host]
__marius__ has quit [Remote host closed the connection]
junsuijin has joined #ocaml
junsuijin has quit [Client Quit]
junsuijin has joined #ocaml
milosn has quit [Ping timeout: 240 seconds]
Kakadu has joined #ocaml
milosn has joined #ocaml
PiepScuim has joined #ocaml
tac-tics has joined #ocaml
joewilliams_away is now known as joewilliams
avsm1 has quit [Quit: Leaving.]
avsm has joined #ocaml
ttamttam has quit [Remote host closed the connection]
emmanuelux has quit [Ping timeout: 244 seconds]
PiepScuim has quit [Quit: Leaving]
ulfdoz has joined #ocaml
ttamttam has joined #ocaml
bobry has joined #ocaml
avsm has quit [Quit: Leaving.]
larhat has quit [Quit: Leaving.]
avsm has joined #ocaml
ttamttam has left #ocaml []
ttamttam has joined #ocaml
__marius__ has joined #ocaml
_habnabit has quit [Changing host]
_habnabit has joined #ocaml
Anarchos has joined #ocaml
ttamttam has quit [Quit: ttamttam]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
avsm has quit [Quit: Leaving.]
lopex has joined #ocaml
sebz has quit [Ping timeout: 244 seconds]
darq has joined #ocaml
sebz_ has joined #ocaml
sebz_ has quit [Client Quit]
darq has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
Boscop has quit [Ping timeout: 252 seconds]
lpereira has joined #ocaml
Anarchos has joined #ocaml
PiepScuim has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ttamttam has joined #ocaml
Anarchos has joined #ocaml
ttamttam has left #ocaml []
Snark has quit [Quit: Quitte]
mnabil has quit [Read error: Connection reset by peer]
mnabil has joined #ocaml
tac-tics has left #ocaml []
ulfdoz has quit [Ping timeout: 276 seconds]
Kakadu has quit [Remote host closed the connection]
Metapioca has quit [Quit: Lost terminal]
<Anarchos> I just need to manipulate types of terms
_andre has quit [Quit: leaving]
ikaros has quit [Quit: Ex-Chat]
avsm has joined #ocaml
seafood has joined #ocaml
Cyanure has quit [Ping timeout: 248 seconds]
edwin has quit [Remote host closed the connection]
Cyanure has joined #ocaml
PiepScuim has quit [Quit: Leaving]
seafood has quit [Quit: seafood]
lpereira has quit [Quit: Leaving.]
Anarchos has left #ocaml []
Associat0r has quit [Quit: Associat0r]
Cyanure has quit [Ping timeout: 260 seconds]
thomasga has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]
Amorphous has quit [Ping timeout: 248 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
Amorphous has joined #ocaml
surikator has joined #ocaml
vram0 has quit [Remote host closed the connection]
Boscop has joined #ocaml
surikator has quit [Quit: Scientific discovery is just maximal compression of strings. Nothing more, nothing less.]
<everyonemines> oh man, why have I only now discovered ~
<everyonemines> doesn't appear in any tutorials I've seen, and so useful
<everyonemines> oh hmm, This expression has type x:int -> y:int -> int but an expression was expected of type int -> int -> int
__marius__ has quit [Ping timeout: 248 seconds]
<everyonemines> So labels require extra type annotations on functions passed as arguments.
<everyonemines> I guess that might be good for avoiding bugs in large projects, but for me it's just annoying.
arubin has joined #ocaml
everyonemines has quit [Quit: Leaving.]
sebz has joined #ocaml
Boscop has quit [Ping timeout: 258 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
djanatyn has quit [Read error: Connection reset by peer]