gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
flux has quit [Remote host closed the connection]
jeddhaberstro has joined #ocaml
jeddhaberstro_ has quit [Read error: Connection reset by peer]
flux has joined #ocaml
smerz has quit [Quit: Ex-Chat]
lopex has quit []
boscop has quit [Ping timeout: 272 seconds]
flux has quit [Remote host closed the connection]
philtor has quit [Ping timeout: 240 seconds]
flux has joined #ocaml
flux has quit [Remote host closed the connection]
flux has joined #ocaml
arubin_ has joined #ocaml
jeddhaberstro_ has joined #ocaml
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro_ is now known as jeddhaberstro
confound has joined #ocaml
oriba has quit [Quit: Verlassend]
<confound> I have a list of two elements (from Str.bounded_split) -- what's the best way to turn it into a tuple? writing pair_of_list [ x; y ] -> (x, y) feels goofy
eb4890 has quit [Ping timeout: 240 seconds]
<mrvn> only way
mfp has quit [Ping timeout: 240 seconds]
tauntaun has quit [Ping timeout: 240 seconds]
jeddhaberstro_ has joined #ocaml
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro_ is now known as jeddhaberstro
<thelema> confound: Use BatString.split and you'll get the pair you want
mfp has joined #ocaml
arubin_ has quit [Ping timeout: 246 seconds]
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro has joined #ocaml
arubin has joined #ocaml
arubin has quit [Quit: arubin]
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro has joined #ocaml
flux has quit [Remote host closed the connection]
flux has joined #ocaml
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro_ has joined #ocaml
flux has quit [Remote host closed the connection]
flux has joined #ocaml
philtor has joined #ocaml
<confound> thelema: thanks
flux has quit [Read error: Connection reset by peer]
flux has joined #ocaml
<confound> I'd read about batteries and forgot to try using it
flux has quit [Remote host closed the connection]
flux has joined #ocaml
jeddhaberstro_ has quit [Read error: Connection reset by peer]
jeddhaberstro has joined #ocaml
jeddhaberstro_ has joined #ocaml
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro_ is now known as jeddhaberstro
flux has quit [Remote host closed the connection]
flux has joined #ocaml
ulfdoz has joined #ocaml
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro has joined #ocaml
sepp2k has joined #ocaml
eye-scuzzy has quit [Ping timeout: 260 seconds]
philtor has quit [Ping timeout: 240 seconds]
eye-scuzzy has joined #ocaml
jeddhaberstro_ has joined #ocaml
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro_ is now known as jeddhaberstro
cyanure has joined #ocaml
jeddhaberstro_ has joined #ocaml
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro_ is now known as jeddhaberstro
Yoric has joined #ocaml
ygrek has joined #ocaml
sepp2k has quit [Quit: Leaving.]
ulfdoz has quit [Ping timeout: 255 seconds]
boscop has joined #ocaml
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ankit9 has quit [Remote host closed the connection]
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
ttamttam has joined #ocaml
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro has joined #ocaml
jeddhaberstro has quit [Client Quit]
ygrek_ has quit [Remote host closed the connection]
ankit9 has joined #ocaml
ygrek_ has joined #ocaml
edwin has joined #ocaml
avsm has quit [Quit: Leaving.]
Yoric has quit [Quit: Yoric]
merijn has joined #ocaml
<merijn> Three quick questions: 1) Is there a function composition operator (Google isn't turning up anything...)? 2) Does OCaml support where clauses (ala Haskell) or just let clauses? 3) Is there a way to ask the REPL to return the type of an expression?
<mrvn> no, yes, only the toplevel
Snark has joined #ocaml
ftrvxmtrx has joined #ocaml
<bitbckt> most people defined |> to mean function composition, I think.
<bitbckt> define*
<bitbckt> e.g. Batteries
<merijn> mrvn: ok, thanks :)
Yoric has joined #ocaml
ikaros has joined #ocaml
ygrek_ has quit [Ping timeout: 240 seconds]
ygrek_ has joined #ocaml
_andre has joined #ocaml
tauntaun has joined #ocaml
tauntaun has quit [Ping timeout: 240 seconds]
hyperboreean has quit [Ping timeout: 240 seconds]
hyperboreean has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
sgnb` is now known as sgnb
tauntaun has joined #ocaml
merijn has left #ocaml []
tauntaun has quit [Ping timeout: 264 seconds]
lopex has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
cyanure has quit [Ping timeout: 250 seconds]
rup has quit [Ping timeout: 240 seconds]
rup has joined #ocaml
ftrvxmtrx has joined #ocaml
ygrek_ has quit [Remote host closed the connection]
yezariaely_ has joined #ocaml
ygrek_ has joined #ocaml
<yezariaely_> is there a possibility to check types using a simple if expression? e.g. if varname = MyTypeInstance(_,_,_)
<yezariaely_> using match this would be possible.
<mrvn> no, you can't use _ in if.
<yezariaely_> mrvn, I recognized that ;) any other possibility to achive what I want without using a match?
<mrvn> if (match varname with MyTypeInstance(_,_,_) -> true | _ -> false) ....
<yezariaely_> ok...
<yezariaely_> thx
<mrvn> I would define a let is_MyTypeInstance = function MyTypeInstance(_,_,_) -> true | _ -> false
<yezariaely_> hmm yeah that would be an option
tauntaun has joined #ocaml
ymasory has joined #ocaml
ymasory has quit [Remote host closed the connection]
seafood has joined #ocaml
tauntaun has quit [Ping timeout: 240 seconds]
ygrek_ has quit [Ping timeout: 240 seconds]
tauntaun has joined #ocaml
seafood has quit [Quit: seafood]
kaustuv has joined #ocaml
kaustuv_ has quit [Disconnected by services]
yezariaely_ has quit [Quit: Leaving]
ymasory has joined #ocaml
ygrek has joined #ocaml
yezariaely1 has joined #ocaml
yezariaely1 has left #ocaml []
lopex has quit []
ccasin has joined #ocaml
npouillard has quit [Ping timeout: 260 seconds]
npouillard has joined #ocaml
npouillard has quit [Ping timeout: 246 seconds]
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
npouillard has joined #ocaml
fholm has left #ocaml []
mnabil has joined #ocaml
lopex has joined #ocaml
<gildor> thelema: ping
<thelema> gildor: pong
<gildor> thelema: would you want to be a mentor for GSoC?
<gildor> thelema: I think you can find one or two things that can be done by student during a GSoC
<thelema> This summer? Sure.
<thelema> Hmm, it's not like batteries has a TODO list a mile long...
<gildor> thelema: well, you just have to write a template proposal
<gildor> thelema: student should proposed on their own a project
<gildor> thelema: but this adds some length to our project proposal list and can help us be approved as a mentor organization for GSoC
<gildor> we = OCaml community at large
<thelema> yes, I read the organization docs you and troestler made
<thelema> I assume I'll be the first template proposal
mfp has quit [Ping timeout: 260 seconds]
<thelema> as I don't see one on the gsoc-team mediawiki
<gildor> thelema: just add yourself to the mentor list here https://forge.ocamlcore.org/plugins/mediawiki/wiki/gsoc-team/index.php/Main_Page
<gildor> thelema: no their are already template proposals, here: https://forge.ocamlcore.org/plugins/mediawiki/wiki/gsoc-team/index.php/GSoC2011/Applying
<thelema> I missed those
<gildor> thelema: well I wrote 4 out of 6 proposals, but it would be better that I take a smaller role here
<gildor> thelema: I also plan to contact unison mailing list
ygrek has quit [Remote host closed the connection]
<thelema> thanks for coordinating this
tauntaun has quit [Ping timeout: 240 seconds]
mfp has joined #ocaml
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ttamttam has quit [Remote host closed the connection]
<thelema> contributions welcome to batteries comparison matrix: https://github.com/ocaml-batteries-team/batteries-included/wiki/Comparison-matrix
philtor has joined #ocaml
<thelema> Especially looking for features available in other (general purpose) libraries that you want in batteries
tauntaun has joined #ocaml
agarwal1975 has joined #ocaml
<gildor> thelema: JS Core -> JaneStreet Core
<gildor> in your matrix
<gildor> JS means something for 99% of people around (and in their mind JS <> JaneStreet)
<thelema> gildor: done.
<thelema> also, it looks like my PhD advisor will prevent me from working on anything not directly related to my research
<gildor> thelema: I can understand
<gildor> but maybe other people in the batteries project can be mentors (if this is what you mean)
<thelema> there are contributions to batteries that would be directly useful in our projects, but my advisor even wants to make that decision
<thelema> I'm all for anyone in batteries being a mentor (elkstrand, bluestorm, mfp)
ygrek has joined #ocaml
Yoric has quit [Quit: Yoric]
CoryDambach has joined #ocaml
<gildor> avsm2, thomasga: you don't need student to help you on MirageOS ?
mnabil has quit [Ping timeout: 240 seconds]
<agarwal1975> i just added a project i'd be happy to mentor.
tauntaun has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
<gildor> agarwal1975: thx
arubin has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 276 seconds]
ftrvxmtrx has joined #ocaml
tauntaun has joined #ocaml
ulfdoz has joined #ocaml
pdhborges has joined #ocaml
kaustuv_ has joined #ocaml
<pdhborges> hi again
<pdhborges> I created some bindings and I'm using oasis
<pdhborges> but after installing the bindings I can't link any native program
<pdhborges> dynlinking from bytecode works though
<pdhborges> for example http://paste.pocoo.org/show/339816/
<thelema> looks like there's a function missing from ZMQ.a
<thelema> err, ZMQ.cmxa
<pdhborges> but tehe cmxa is automatically created by oasis
tauntaun has quit [Quit: Ex-Chat]
<thelema> then I guess it's not including all the needed dependencies - can you check that your zmq stubs are being linked in?
<kaustuv_> What is the exact ocamlopt invocation? (run with ocamlfind ocamlopt -verbose)
* thelema is reminded that uint still needs to be merged with batteries
<kaustuv_> Do the stubs not have any external dependencies like a zeromq library?
<pdhborges> they have
<pdhborges> its the -lzmq flag
<pdhborges> wwierd
<pdhborges> for uint
<pdhborges> it links the stubs again
<pdhborges> for my lib it onyl links ZMQ
<kaustuv_> are your stubs for zmq in ZMQ.a, or in zmq_stubs.a?
<kaustuv_> as I don't see a -lzmq_stubs
<pdhborges> subs are on libZMQ.a
<kaustuv_> I guess you should find out exactly what has the symbols _caml_zmq_init, etc. and make sure that it's present on the gcc line
<adrien> is ld case-sensitive? iirc you can have a name conflict at this step
<pdhborges> that's a goog point
<pdhborges> kaustuv_: libZMQ.a has the symbols
dark has joined #ocaml
<kaustuv_> Mac OS X has case insensitive file names? Ugh.
<thelema> kaustuv_: case-preserving, even.
<dark> I read a pdf presentation file of Chris Casinghino's pcl. But I can't find it anywhere. Is there some place to download this library? Also, some documentation..
<pdhborges> kaustuv_: it's optional
_andre has quit [Quit: leaving]
<pdhborges> dam chaging the module name isn't as easy as I thought
<thelema> dark: the parser combinator library? I remember that being hard to find... let me check if I've got it bookmarked
ymasory has quit [Remote host closed the connection]
<dark> yes..
<gildor> pdhborges: ocamlmklib should embed information about library to link
<thelema> dark: it might only be on jane street's public svn
<dark> ,-.
<kaustuv_> Isn't ccasin on this channel?
<dark> The code for the projects is available in our SVN repository: svn://osprepo.janestcapital.com/osp/2007 ok
<thelema> kaustuv_: haven't heard from him in forever.
<dark> ccasin, oh are you here? :P
<pdhborges> wth
<pdhborges> I just changed the _oasis file
<dark> anything else on pcl aside from that presentation?:P
<pdhborges> replacing the name ZMQ
<pdhborges> with ZMQB and now it won't build
<pdhborges> lol
<thelema> dark: I have a svn checkout - I don't seem to be able to update, so you may not be able to check it out.
ankit9 has quit [Read error: Connection reset by peer]
<dark> svn: Can't connect to host 'osprepo.janestcapital.com': Connection refused
<dark> @.@
<gildor> pdhborges: if the .cmxa is create and the .so/.a installed are here, there should be no problem (tm)
<pdhborges> gildor: now it is trying to build a lexer file lol
<gildor> pdhborges: no the lexer file is the default fallback of ocamlbuild, that is always the same strange error from ocamlbuild
<pdhborges> a
<pdhborges> but I just changed the library name
<gildor> it is just ocamlbuild not finding any solution to compile a module
<pdhborges> it was working just a second ago
<gildor> i.e. you don't have a file ZMQB.ml
<pdhborges> a
<dark> thelema, oh, can you send again?
<pdhborges> :\ Name conflict fml
<gildor> pdhborges: you can get the linker flag with ocamlobjinfo _build/.../*.cma
<dark> thank you ^^
<pdhborges> thanks everyone
<gildor> pdhborges: you solve your problem ?
<pdhborges> I need a new name for the bindings
<pdhborges> yes It was the fricking name
<gildor> yes, that is a frequent problem: you have libzmq.a in your ocaml binding and libzmq.a from ZMQ itself
<pdhborges> gildor: how do you name your bindings then?
<gildor> you have to rename the library to something like ozmq
<gildor> (for now, I will patch it in the next version)
<gildor> If you want to keep the findlib name, use "FindlibName: zmq"
* adrien curses at the spaghetti in lablgtk's propcc.ml4 and goes making some to put in a plate rather than in code
<pdhborges> gildor: but then users will have to open the library with the wierd Name right?
<pdhborges> as open ZMQB
kaustuv_ has quit [*.net *.split]
npouillard has quit [*.net *.split]
<gildor> pdhborges: you don't have to change the module name
<pdhborges> a ok
<gildor> there is the .cma/.cmxa name which is what you load on the command line (except if you use findlib)
<gildor> and there is the .cmi name matching modules embeded into the .cma/.cmxa
<gildor> you open the second
<pdhborges> thanks
<gildor> i.e. you should rename your module ZMQB to ZMQ (as it was before)
<gildor> the problem was with the name of the stub library
<gildor> i.e. dllXXX.so and libXXX.a
<gildor> XXX = library name = oasis section name = Library "zmq"
Snark has quit [Quit: Ex-Chat]
* gildor time for dinner
<pdhborges> ok last question for today
<pdhborges> why does printf never print
<pdhborges> it's optional
kaustuv_ has joined #ocaml
<pdhborges> looks like ocaml has more conservative flushes than libc
npouillard has joined #ocaml
<adrien> should be set with setvbuf, don't know how ocaml configures it
<adrien> I tend to use "%!" with printf to flush immediately
eye-scuzzy has quit [Quit: leaving]
<pdhborges> mine is set tu flush on new line
<pdhborges> (in C)
philtor has quit [Ping timeout: 240 seconds]
eye-scuzzy has joined #ocaml
jonathandav has quit [Read error: Connection reset by peer]
mikemc has quit [Read error: Connection reset by peer]
mcclurmc has quit [Read error: Connection reset by peer]
jonathandav_ has joined #ocaml
mikemc has joined #ocaml
mcclurmc has joined #ocaml
<ccasin> dark: hi
<ccasin> oh, looking for pcl
<ccasin> sadly I never put together a good release of that, mostly because I have seem to find the time to explore and pick from the various ocaml packaging tools
<ccasin> I really should though
<ccasin> at any rate, if you want the code just email me and I am happy to send it to you
<ccasin> it's even documented
<dark> oh i got it. and i could make the docs, yeah (but the ocamldoc call wasn't on the makefile). it's nice :)
<dark> i was trying to do something with parsec but my haskell is very poor .-.
<ccasin> dark: great. my local copy is probably better documented and more correct than whatever is left on jane st's servers, so you may want to email me anyway :)
<dark> ccasin@seas.upenn.edu ?
<ccasin> yep!
<ccasin> or just tell me your address and I'll send it to you
<dark> sent
<dark> but actually i have problems with the whole parsec style
<dark> for example, i'm struggling on how to make a parser that receives a string, and returns a pair with the first word, and the rest of the string. like "a b c" -> ("a", "b c")
<dark> i was looking at a parser you use as example p >>= fun r1 −> q >>= fun r2 −> return (r1,r2)
<dark> it parsers p, then q, and return the pair
<dark> so i suppose i would just make p a parser that parsers a word, and q a parser that accepts everything
<ccasin> yep
<ccasin> sounds reasonable
enthymeme has joined #ocaml
<ccasin> personally, I think parser combinators are great fun. But, they are only a stop gap until we finally get good, general automated parsing tools.
<ccasin> Trevor Jim has done some great work lately on Yakker (though I don't know if it has been released yet).
<dark> if i were to write this in do notation (supposing it is haskell and we have \ instead of the funs) it would be do { r1 <- p; r2 <- q; return (r1, r2) } ?
udzinari has joined #ocaml
<ccasin> yes, that looks right
vouillon has joined #ocaml
<dark> this is awfully complicated to me
<ccasin> I find it to be quite natural - you collect the results of several parsers and then do whatever you like with them
<dark> I saw that there are modules for parsing whole languages, or more complex things (like Token from both parsec and pcl, and your Language)
<ccasin> but it does take a little getting used to the first time you see it (especially if you haven't written much monad stuff before)
<udzinari> Hello, sorry if my question is inappropriate, but.. what is the best book to learn ML/Ocaml basics? my goal being to go through Modern compiler implementation in ML without going crazy.
<ccasin> dark: yes, these are tools for building expression parsers. Of course, you could also do it using the other basic tools - it's just a convenience
<dark> udzinari, i like http://caml.inria.fr/pub/docs/manual-ocaml/index.html (official documentation), plus it is up to date. http://caml.inria.fr/pub/docs/oreilly-book/ seems interesting
vouillon has left #ocaml []
vouillon has joined #ocaml
vouillon has left #ocaml []
<dark> http://caml.inria.fr/pub/docs/u3-ocaml/index.html another book. i think those books benefited me mainly for the discussion of objects vs. modules
Yoric has joined #ocaml
<thelema> ccasin: any chance you could put it up on github, since it doesn't have any internet repo?
<udzinari> thanks for the links!
<dark> I wanted to make this parser: I get the first word, then I use it to decide how to parse the rest. can this parse be done?
<thelema> ccasin: this yakker?
<thelema> (interesting that attresearch has a github account)
<ccasin> thelema: I will try and get it up tonight - people do occasionally ask me for it, so I should really just put it out there
<thelema> ccasin: thanks
jonathandav__ has joined #ocaml
<ccasin> thelema: yes, that looks like it. Last time I heard him talk about it, ATT hadn't approved the release yet
mikemc has quit [Read error: Connection reset by peer]
jonathandav_ has quit [Read error: Connection reset by peer]
mcclurmc has quit [Read error: Connection reset by peer]
<thelema> looks like it's the only repo on their account.
<ccasin> dark: sure - what's great is that inside the body of the (fun r1 -> ...) you can do whatever you like, including inspecting r1
<dark> it would be like. parse_word >>= fun word -> build_next_parser_from_word word. but this is just parse_word >>= build_next_parser_from_word, so this get confusingly simple oO
mikemc has joined #ocaml
mcclurmc has joined #ocaml
<ccasin> dark: for example:
<thelema> and it's awesomely bad that they're importing part of batteries as a subdirectory
<dark> so i would do like let build_next_parser word = if class_one word then parser_one else if .. ?
<ccasin> dark: exactly
ulfdoz has quit [Ping timeout: 240 seconds]
<ccasin> for example: let parse_music_type () = letter >>= (fun ch -> if ch = 'C' then char 'D' else (if ch = 'L' then 'P' else fail "invalid type"))
<ccasin> this parses either "CD" or "LP", by getting the first letter than looking for the appropriate second one
<ccasin> (of course, there are better ways to write this particular parser, it's just an example)
<ccasin> also there is a bug: should be (if ch = 'L' then char 'P' ...
<dark> where char 'P' is a parser?
<ccasin> yes, it's defined in "CharParse.ml"
<ccasin> it just parses one character or fails
agarwal1975 has left #ocaml []
agarwal1975 has joined #ocaml
<thelema> dark: I'm tempted to pastebin (or github) an old project of mine that uses a different (but similar) parser combinator library to parse ebml. It's 38K of source
<dark> github it :)
<dark> is it the one at batteries?
<thelema> ? I don't think I've published this before
<dark> there is a parser combinator library there
<thelema> no, it's not the batteries library either, it's cf_lib's one. IIRC, it was based on parsec too, so many things should be similar
<thelema> the parser stuff starts on line 612
pdhborges has quit [Ping timeout: 245 seconds]
udzinari has quit [Read error: Connection reset by peer]
udzinari has joined #ocaml
Edward has joined #ocaml
<adrien> I've been really spoiled by ocamlbuild and friends =/
<thelema> adrien: yes, makefiles are garbage
<dark> thelema, and you like omake?
<adrien> I want so split a .ml4 file from lablgtk2 (camlp4 parsing) into two files and, hmmm, it could be already done with ocamlbuild
<thelema> I used it with batteries for a while. I don't like it - having new languages for specifying build seems ugly.
<thelema> redo might be a solution.
<adrien> rrrrrrrraaaaaaaaaaaahhhhhhhhhhhhhhhh
<adrien> looks like I really really really really really want oasis 0.3.0 right now :P
pdhborges has joined #ocaml
<gildor> adrien: what the pb
<adrien> gildor: so I can use it for lablgtk2 ;-)
<gildor> adrien: ah yes ;-)
<gildor> ocamlbuild is a beast to tame
<pdhborges> is this book any good or is it really outdated http://caml.inria.fr/pub/docs/oreilly-book/html/index.html ? It has more information about how the Gc works and how C bindings work.
<gildor> more like a low level Makefile
<gildor> pdhborges: outdate but still useful
<pdhborges> gildor: looking at the index it seems to be just hight level stuff
<gildor> pdhborges: there is a section about string...
<gildor> pdhborges: not that high level stuff
edwin has quit [Remote host closed the connection]
gildor has quit [Ping timeout: 240 seconds]
gildor has joined #ocaml
tauntaun has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
tauntaun has quit [Quit: Ex-Chat]
ikaros has quit [Quit: Leave the magic to Houdini]
ccasin has quit [Quit: Leaving]
philtor has joined #ocaml
* pdhborges realizes the initial types for the project are wrong
* pdhborges realizes big modifications are necessary /facepalm
pdhborges has quit [Quit: Page closed]
agarwal1975 has quit [Quit: agarwal1975]
Yoric has quit [Quit: Yoric]
Edward has quit []
zzz_ has quit [Quit: Bye]
zzz_ has joined #ocaml
arubin has quit []
joewilliams is now known as joewilliams_away
lamawithonel has quit [Ping timeout: 255 seconds]