flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
jonasb has quit [Read error: 110 (Connection timed out)]
rhar has joined #ocaml
<Yoric[DT]> jonasb_: never tried.
<Yoric[DT]> And not tonight :)
Yoric[DT] has quit ["Ex-Chat"]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
psnively has quit []
AxleLonghorn has joined #ocaml
<AxleLonghorn> let move_tree (Node ((label,pos), subtrees)) newx = Node((label, pos+.newx), subtrees)
<AxleLonghorn> I didn't know ocaml had pattern matching for arguments, has it always been this way?
rhar has left #ocaml []
olegfink has left #ocaml []
oleg|log has joined #ocaml
oleg|log has quit ["WeeChat 0.2.6"]
oleg|log has joined #ocaml
ofaurax has quit ["Leaving"]
|jeremiah has quit [Read error: 104 (Connection reset by peer)]
|jeremiah has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
jonasb_ has quit [Read error: 113 (No route to host)]
slash_ has quit ["leaving"]
hsuh has quit [Remote closed the connection]
jeddhaberstro has joined #ocaml
caligula_ has joined #ocaml
ched_ has joined #ocaml
ched has quit [Read error: 110 (Connection timed out)]
caligula__ has quit [Read error: 110 (Connection timed out)]
AxleLonghorn has quit [Read error: 60 (Operation timed out)]
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
seafood has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
spooXe has joined #ocaml
<spooXe> please visit http://pages.ykt.ru/svalka/
spooXe has quit ["http://pages.ykt.ru/svalka/ - ïðîãðàììû, èãðû è ìíîãîå äðóãîå òîëüêî ó íàñ ! Ññûëêè íà ôàéëû http://file.ya1.ru - http://temp]
<alexyk> huh, Russian software?
alexyk has quit []
alexyk has joined #ocaml
alexyk has quit [Client Quit]
alexyk has joined #ocaml
alexyk_ has joined #ocaml
alexyk has quit [Read error: 110 (Connection timed out)]
Associat0r has joined #ocaml
alexyk_ has quit []
alexyk has joined #ocaml
jeddhaberstro has quit []
seafood has joined #ocaml
alexyk has quit []
seafood has quit []
itewsh has joined #ocaml
Camarade_Tux has joined #ocaml
Stefan_vK has joined #ocaml
slash_ has joined #ocaml
ttamttam has joined #ocaml
Stefan_vK1 has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
marmotine has joined #ocaml
Mr_Awesome has joined #ocaml
ikaros has joined #ocaml
mat3schk3 has joined #ocaml
<mat3schk3> userhost
<mat3schk3> q
<mat3schk3> uit
mat3schk3 has quit ["Leaving"]
slash__ has joined #ocaml
slash__ has quit [Client Quit]
kc8pxy has quit [Read error: 110 (Connection timed out)]
slash_ has quit [Read error: 110 (Connection timed out)]
ofaurax has joined #ocaml
slash_ has joined #ocaml
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
* Camarade_Tux waves at Yoric[DT]
Cheshire has joined #ocaml
ched_ has quit [Read error: 54 (Connection reset by peer)]
ched has joined #ocaml
chicco has joined #ocaml
ttamttam has left #ocaml []
Cheshire has quit [Read error: 113 (No route to host)]
Cheshire has joined #ocaml
tripwyre has joined #ocaml
tripwyre has quit [Client Quit]
_fh_ has joined #ocaml
<_fh_> hello, do you know if there's a yacc specification for ocaml's grammar (or even a subset, I'm mainly interested in arithmetic expressions and function abstraction and application) somewhere?
<oleg|log> _fh_: parsing/parser.mly
<_fh_> thank you
ChristopheT has joined #ocaml
Cheshire has quit ["Leaving"]
sporkmonger has joined #ocaml
slash_ has quit ["leaving"]
Cheshire has joined #ocaml
alexyk has joined #ocaml
vovkaii has joined #ocaml
marmotine has quit ["mv marmotine Laurie"]
ikaros has quit [".quit"]
ikaros has joined #ocaml
ttamttam has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
ttamttam has left #ocaml []
alexyk has quit []
elodie4 has joined #ocaml
<elodie4> salut
<yziquel_> hi.
alexyk has joined #ocaml
alexyk has quit [Client Quit]
xcx has joined #ocaml
xcx has quit [Read error: 60 (Operation timed out)]
xcx has joined #ocaml
xcx is now known as elodie44
elodie4 has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
elodie4 has joined #ocaml
elodie44 has quit [Read error: 110 (Connection timed out)]
elodie4 has quit [Read error: 110 (Connection timed out)]
AxleLonghorn has joined #ocaml
AxleLonghorn has quit [Client Quit]
AxleLonghorn has joined #ocaml
oriba has joined #ocaml
<AxleLonghorn> would someone care to look over the OCaml code there and tell me how to make it match the SML code better?
<flux> well, a direct translaction would be let rec merge = function ([], qs) -> qs | (ps, qs) -> ps | ((p, _)::ps, (_, q)::qs) -> (p, q) :: merge (ps, qs)
<flux> but with multi-argument functions (sml prefers to use tuples instead of currying) the parameters need to be named
<flux> actuallyhm
<flux> why do you have Extent constructor there?
<AxleLonghorn> that's a very good question. The answer is that I don't know how to do it a better way.
<flux> simply do it the same way in sml. the Extent type there is mostly for a cleaner interface, it doesn't actually do anything.
<AxleLonghorn> how do I ensure that the type of merge becomes (extent*extent) -> extent, rather than ((float*float) list) * ((float*float) list) -> (float * float) list
<flux> well, they are the same
<flux> you can annotate the return type with : extent list if you wish
<flux> or you can give the types in your interface part (.mli)
<AxleLonghorn> ocaml wont mind if I call a function with an extent type when it asks for (float*float) list?
<flux> no
<AxleLonghorn> good to know
<AxleLonghorn> I thought it mattered
<flux> well, if it can know extent is the same as float
<flux> you can hide that in an interface
<flux> and after that the types are not convertible without an explicit conversion function
<flux> type t = float let a (f : t) : t = f let b = a 4.0 will work
<flux> but, module F : sig type t end = struct type t = float end include F (..and the same lets..) will not compile
<AxleLonghorn> how do you specify the type of a return value?
<AxleLonghorn> I've never really had to in the past, just parameters
<AxleLonghorn> should I do that in a .mli file rather than in the .ml file?
<flux> you specify interface in an .mli-file
<flux> you can run ocamlc -i foo.ml to get one
<flux> you'll probably end up redacting it quite a bit, if the .ml-file is big
<AxleLonghorn> thanks for your help flux
<thelema> flux: | (ps, qs) -> ps ??? (your code reply to AxleLonghorn
alexyk has quit []
<flux> oh, there might be bugs :)
<thelema> me thinks so
<AxleLonghorn> does OCaml have a curry function in the standard lib?
alexyk has joined #ocaml
<flux> no
<AxleLonghorn> bummer
<AxleLonghorn> sometimes I wish Pervasives was like haskell's Prelude
alexyk has quit []
<flux> well, there are projects that attempts to address that, for example batteries
ttamttam has joined #ocaml
<flux> or you could use kig's prelude.ml from http://github.com/kig/preludeml/tree/master
<thelema> which will be integrated into batteries in the near future.
<AxleLonghorn> cool, I like the sound of batteries
<AxleLonghorn> oh hey, kig must be the guy who wrote the quickcheck module
<thelema> AxleLonghorn: we just need to make it easier for people to install by hand. (dependencies)
<AxleLonghorn> is it possible in ocaml to create a function like haskell's $?
<flux> yes, it is! let ($) a b = a b :)
<flux> but using $ is not a great idea, as it is used by camlp4 (for something)
<Yoric[DT]> let ( **> ) a b = a b
<flux> you know, three letters is exactly the same you need for " ()" ;-)
<flux> there is the added benefit of not needing to put a closing paren at the end, yes..
mttobks has joined #ocaml
<AxleLonghorn> is there an easy way of pattern matching multiple parameters?
<AxleLonghorn> let me rephrase, a pretty way, rather than doing multiple matches
<AxleLonghorn> or is this the best way of doing it: let fit pextent qextent = match pextent,qextent with ... -> ...
<flux> yes
<flux> that's pretty much the only way
<flux> I suppose you could use let curry2 f a b = f (a, b) and then curry2 (function ...), with the curry function you were looking earlier
<kig> AxleLonghorn: nope, i got it from jane street core and they got it from a ML post. but i did extend it somewhat
<kig> (quickcheck)
<AxleLonghorn> (I saw your blog post is where I remembered it from)
Stefan_vK has quit [Read error: 104 (Connection reset by peer)]
Stefan_vK has joined #ocaml
<kig> $ is bad in ocaml because it has wrong associativity, List.map succ $ List.filter [1;2;3];; errors
<kig> eerrrr
<kig> nevermind that
<kig> List.map succ $ List.filter (fun x -> x < 2) $ List.map pred [1;2;3]
<kig> parses as (map succ $ filter (lt 2)) $ map pred [1;2;3]
ched has quit ["Ex-Chat"]
ched has joined #ocaml
<thelema> yes, in order to do $ as composition, we need to change associativity.
<thelema> Yoric[DT]: would it be possible to have a batteries-custom ocamlbuild that has our myocamlbuild rules/code built in?
<thelema> So that ocamlbuild can be used without copying _tags and myocamlbuild.ml into source tree
<flux> wish ocamlbuild had a less centralized mechanism than myocamlbuild.ml.. batteries could somehow just hook into that.
Associat0r has quit [Connection timed out]
AxleLonghorn has left #ocaml []
ygrek has quit [Remote closed the connection]
<Yoric[DT]> thelema: flux: good idea.
<Yoric[DT]> I'm not quite sure how to do this, though.
<Yoric[DT]> ertai: ping
<Yoric[DT]> The problem, for the moment, is that you can only have one myocamlbuild.ml .
<Yoric[DT]> mmmmhhh....
<Yoric[DT]> I believe we can do something.
<Yoric[DT]> Actually something quite simple.
<Yoric[DT]> Okay, experimental version pushed to the git :)
oriba has quit ["Verlassend"]
<thelema> Yoric[DT]: is the rebase thing ok?
ChristopheT has left #ocaml []
ikaros has quit [".quit"]
thelema has quit ["My damn controlling terminal disappeared!"]
thelema has joined #ocaml
alexyk has joined #ocaml
jonasb has joined #ocaml
<Yoric[DT]> thelema: I still need to get my head around that.
ttamttam has quit [Remote closed the connection]
Camarade_Tux has quit ["Leaving"]
_fh_ has quit ["Leaving"]
Cheshire has quit ["Leaving"]