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