adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
silkwood has quit [Ping timeout: 252 seconds]
oriba has quit [Quit: oriba]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
ahokaomaeha has quit [Ping timeout: 245 seconds]
tac-tics has quit [Quit: Page closed]
tac has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
TDJACR has joined #ocaml
ben_zen has quit [Quit: leaving]
zen_ben has joined #ocaml
zen_ben is now known as ben_zen
parlancho has quit [Ping timeout: 260 seconds]
ManAmongHippos has joined #ocaml
justdit_ has joined #ocaml
justdit_ has quit [Client Quit]
yacks has joined #ocaml
ben_zen has quit [Read error: Operation timed out]
zen_ben has joined #ocaml
zen_ben is now known as ben_zen
ben_zen_ has joined #ocaml
silkwood has joined #ocaml
groovy2shoes has joined #ocaml
ben_zen_ has quit [Quit: leaving]
ManAmongHippos has quit [Ping timeout: 255 seconds]
groovy2shoes has quit [Quit: Computer has gone to sleep]
andreypopp has joined #ocaml
tac has quit [Ping timeout: 245 seconds]
andreypopp has quit [Quit: sleep]
andreypopp has joined #ocaml
mye_ has joined #ocaml
mye has quit [Ping timeout: 255 seconds]
mye_ is now known as mye
yacks has quit [Quit: Leaving]
darkf has quit [Quit: Leaving]
darkf has joined #ocaml
darkf_ has joined #ocaml
darkf_ has quit [Read error: Connection reset by peer]
hcarty has quit [Remote host closed the connection]
andreypopp has quit [Quit: sleep]
osa1 has joined #ocaml
<osa1> what does Lexing.empty_token mean ? I mean, why lexer throws that exception ?
<pippijn> your rules are not exhaustive
<osa1> hmm
<pippijn> maybe you're missing the eof rule
<osa1> pippijn: that was exactly the case
<osa1> thanks
malc_ has joined #ocaml
ttamttam has joined #ocaml
malc_ has left #ocaml []
Cyanure has joined #ocaml
andreypopp has joined #ocaml
dabd_ has quit [Read error: Operation timed out]
gour has joined #ocaml
andreypopp has quit [Quit: sleep]
djcoin has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Yoric has joined #ocaml
ftrvxmtrx_ has joined #ocaml
andreypopp has joined #ocaml
jave has joined #ocaml
yacks has joined #ocaml
ontologiae has joined #ocaml
AltGr has joined #ocaml
Cyanure has joined #ocaml
cago has joined #ocaml
cdidd has joined #ocaml
cyball has joined #ocaml
mika1 has joined #ocaml
mye has quit [Ping timeout: 244 seconds]
<osa1> does OCaml have id function in it's standard ?
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
<adrien_oww> 'a -> 'a ? no
<osa1> yes
<flux> it curiously does have compiler support for one, but doesn't expose it in the standard library
ontologiae has quit [Ping timeout: 244 seconds]
<osa1> do we have a place to search in standard library by name or type ?
ttamttam has quit [Remote host closed the connection]
<adrien_oww> ocamlbrowser; it's a labltk application
<adrien_oww> there's also something on godi's websiet
<osa1> adrien_oww: what is godi's website ?
f[x] has joined #ocaml
<adrien_oww> look it up :P
<adrien_oww> something camlcity :P
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
hkBst has quit [Ping timeout: 260 seconds]
osa1 has quit [Ping timeout: 245 seconds]
mye has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
RagingDave has joined #ocaml
thomasga has joined #ocaml
Yoric has joined #ocaml
ontologiae has joined #ocaml
ocp has joined #ocaml
_andre has joined #ocaml
ocp has quit [Client Quit]
ocp has joined #ocaml
ontologiae has quit [Client Quit]
ttamttam has joined #ocaml
hkBst__ has joined #ocaml
hkBst_ has quit [Read error: Connection reset by peer]
hkBst__ is now known as hkBst
answer_42 has joined #ocaml
mcclurmc has quit [Ping timeout: 248 seconds]
ontologiae has joined #ocaml
yacks has quit [Ping timeout: 245 seconds]
osa1 has joined #ocaml
<osa1> does anyone here remember pottier's "modern eye on ml type inference" paper ? did he published last 2 chapters of it ?
Yoric has quit [Ping timeout: 276 seconds]
yacks has joined #ocaml
rossberg has joined #ocaml
yacks has quit [Ping timeout: 255 seconds]
erlangonxen has quit [Ping timeout: 245 seconds]
RagingDave has quit [Quit: Ex-Chat]
chambart has joined #ocaml
yacks has joined #ocaml
gour has quit [Disconnected by services]
gour_ has joined #ocaml
fab_ has joined #ocaml
mcclurmc has joined #ocaml
<fab_> i declared the type (type label = string;;), in a function instead of returns (label*int) returns (string*int) how can i change the result type?
<flux> ("hello":label), 42
<flux> if of course won't help with anything but error messages and interactive type retrieval
<fab_> i have to do this for all the entries?
<flux> well, you can have a function do it for you
<flux> if you want to prevent accidental operating as string, you need to either hide the type: module Label : sig type t val mk_label : string -> label val string_of : label -> string end = struct type t = string let mk_label x = x let string_of x = x end
<flux> ..or add a constructor: type label = Label of string
<fab_> let rec comp_exp e = match e with True->[("",1)] |False->[("",0)]
<flux> from the ocaml's point of view label is just another name for string, or that string is just another name for label
<fab_> the functions is something like this
<fab_> but with more lines
<flux> with this: let mk x y = ((x : label), y) you can do True -> [mk "" 1]
<flux> you could annotate the whole function
<flux> let rec comp_exp e : (label * int) list = ..
chambart has quit [Remote host closed the connection]
<fab_> ok works just putting "":label on the first, than it induces the type
<fab_> thanks
<fab_> all the ocaml ide are so ackwards
hkBst has quit [Read error: Connection reset by peer]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
<fab_> awkward*
fab_ has left #ocaml []
Yoric has joined #ocaml
hkBst has quit [Ping timeout: 260 seconds]
parlancho has joined #ocaml
chambart has joined #ocaml
yacks has quit [Remote host closed the connection]
mye has quit [Quit: mye]
ontologiae has quit [Ping timeout: 245 seconds]
mye has joined #ocaml
yacks has joined #ocaml
tac has joined #ocaml
<flux> that Datalog module seems pretty interesting (announced in the ocaml list), now all I need is problems that are suitable for prolog to solve :)
<djcoin> :)
tac has quit [Ping timeout: 245 seconds]
rixed has joined #ocaml
clan_ has joined #ocaml
rossberg has quit [Ping timeout: 260 seconds]
yacks has quit [Ping timeout: 255 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
clan has quit [Ping timeout: 256 seconds]
yacks has joined #ocaml
answer_42 has joined #ocaml
mye_ has joined #ocaml
invariant has quit [Quit: ZNC - http://znc.in]
Yoric has quit [Ping timeout: 252 seconds]
ontologiae has joined #ocaml
mye has quit [Ping timeout: 260 seconds]
mye_ is now known as mye
Yoric has joined #ocaml
rossberg has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
mcsquiggedy has joined #ocaml
dwmw2_gone is now known as dwmw2
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
Anarchos has joined #ocaml
gour_ is now known as gour
silkwood has quit [Ping timeout: 276 seconds]
leoncamel has joined #ocaml
Itewsh has joined #ocaml
paintcan has joined #ocaml
dabd_ has joined #ocaml
ahokaomaeha has joined #ocaml
darkf has quit [Quit: Leaving]
rwmjones has quit [Read error: Operation timed out]
q66 has joined #ocaml
mcsquiggedy has quit [Ping timeout: 245 seconds]
Snark_ has joined #ocaml
mcsquiggedy has joined #ocaml
Snark_ is now known as Snark
osa1 has quit [Ping timeout: 245 seconds]
rwmjones has joined #ocaml
ttamttam has quit [Quit: ttamttam]
cago has left #ocaml []
jamii has joined #ocaml
tac has joined #ocaml
parlancho has quit [Read error: Connection reset by peer]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
cyball has quit [Ping timeout: 252 seconds]
mika1 has quit [Quit: Leaving.]
gnuvince has quit [Ping timeout: 252 seconds]
ftrvxmtrx_ has quit [Quit: Leaving]
tac has quit [Ping timeout: 245 seconds]
ttamttam has joined #ocaml
ahokaomaeha has joined #ocaml
cyball has joined #ocaml
RagingDave has joined #ocaml
jknick has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
thomasga has quit [Quit: Leaving.]
clan_ has quit [Remote host closed the connection]
hkBst has quit [Quit: Konversation terminated!]
smondet has joined #ocaml
ahokaomaeha has quit [Ping timeout: 255 seconds]
andreypopp has quit [Quit: sleep]
osa1 has joined #ocaml
Pantoufle has joined #ocaml
ttamttam has quit [Quit: ttamttam]
tac has joined #ocaml
cyball has quit [Remote host closed the connection]
samposm has left #ocaml []
Cyanure has joined #ocaml
jbrown__ has joined #ocaml
|jbrown| has quit [Ping timeout: 276 seconds]
andreypopp has joined #ocaml
andreypopp has quit [Client Quit]
ocp has quit [Quit: Leaving.]
Submarine has joined #ocaml
ttamttam has joined #ocaml
chambart has quit [Ping timeout: 276 seconds]
tane has joined #ocaml
cyball has joined #ocaml
parlancho has joined #ocaml
ro_ has joined #ocaml
<ro_> Hello.
<ro_> I'm a total newbie trying to lear ocaml, and I got the impression that it could be somewhat desirable to use oasis as a build system.
<ro_> I'm trying to use the batteries library, but I can't get past the linking stage: I keep getting those "Reference to undefined global `BatNum`" every time I try to compile my simple projet.
<orbitz> -linkpkg
<mcsquiggedy> There isn't really a build system that works smoothly and consistently; I spent a couple days of wasted effort trying to get oasis to work on my machine. omake is a little better, but that could just be me.
<orbitz> I just use makefile's :)
<gour> anything else besides those?
<mcsquiggedy> Either way, prepare to have the build infrastructure for your project work on exactly one machine. Two if you're lucky.
<orbitz> ocamlmakfile from mark mottul
<ro_> mcsquiggedy, that will surely be a disappointement later, but since I'm only trying to learn even working on exactly one machine, mine, would be "good enough" :)
<orbitz> i used that initially
<orbitz> it works good for simple well defined things
<orbitz> Actually given my current workflow i could probably switch back to it if I wanted
<mcsquiggedy> If you do go with omake, know that you run the possibility of voodoo errors coming out of nowhere. Just this morning, I had sexplib throwing errors on modules that didn't even use it. Then, when I literally copied every file in the directory into a new directory, it all worked.
<mcsquiggedy> I still don't know what was going wrong.
<ro_> I'm trying to write a simple lexer/parser with a simple CLI around it, and maybe a few external dependencies (like batteries). What would you advise me to use ?
ottbot has quit [Ping timeout: 260 seconds]
<mcsquiggedy> I have yet to successfully use batteries for anything. My advice would be to consult the google gods, and use whichever has been used and documented by another developer.
andreypopp has joined #ocaml
<ro_> mcsquiggedy, That's what I tried to do, but I may not know enough about the ocaml ecosystem to find relevant information, or it is simply not there...
<ro_> mcsquiggedy, when you say "successfully", do you refer to the build complexity, or to the quality of the library/API itself ?
<mcsquiggedy> OCaml... doesn't really have an ecosystem.
<gour> ??
<mcsquiggedy> I was referring to the building process. OCaml code is usually very well-behaved. Building is quirky on a good day.
ottbot has joined #ocaml
travisbrady has joined #ocaml
<gour> considering there is attempt to improve situation with 'batteries', then OPAM package manager, it would be nice to have stable/robust build system
mye has quit [Ping timeout: 260 seconds]
<orbitz> ro_: i'd checkout http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=399 it's what I started with
<thelema_> gour: ocamlbuild is trying to fill in that gap, although not perfectly
ottbot has quit [Ping timeout: 252 seconds]
ahokaomaeha has joined #ocaml
<ro_> Thank you both, I'll consider using OCamlMakefile if I can't get oasis to work how I want it to.
<thelema_> mcsquiggedy: what is your problem with getting batteries to work?
<mcsquiggedy> thelema_: That was about a year ago, so it's mostly faded to a hair-tearing haze.
<jonafan> mcsquiggedy: how do you get ocaml software
<thelema_> mcsquiggedy: ah, before 2.0. Let me know if you have any problems with batteries 2.0
<travisbrady> Is failwith considered bad/harmful/non-idiomatic?
<thelema_> no
<mcsquiggedy> jonafan: i use godi, for better or worse
<jonafan> godi is okay
ontologiae has quit [Ping timeout: 246 seconds]
<mcsquiggedy> labltk-via-godi is throwing linking errors on exactly one of my machines, but there's no such thing as a perfect crime.
<jonafan> i have yet to suffer tk
<jbrown__> ro_: I'm another normal-Make abuser, e.g. https://github.com/crtc-demos/tevsl/blob/master/Makefile -- hth! Not necessarily good style, portable or complete...
<jbrown__> (or rather gmake, I guess.)
jbrown__ is now known as jbrown
<ro_> Honestly, it is really cheering me up to get so much support here, but I find it somewhat "scary" that noone here seems to agree on a "canonical" or "default" build system...
<jbrown> what, like there is for C? :-)
<ro_> jbrown, good point :)
<jonafan> ocamlbuild <--
<Qrntz> my vote goes to ocamlbuild
<companion_cube> +1
* thelema_ recommends ocamlbuild
<ro_> Could I paste a simple source file, if anyone can help me build it ... I'm surely making a stupid mistake, either in the source code or while trying to build it.
<thelema_> ro_: what's the error?
<ro_> Reference to undefined global "BatNum"
<thelema_> what's the compilation command?
Itewsh has quit [Quit: Quitte]
<ro_> ocamlfind ocamlc -package batteries -linkpkg test.ml
<thelema_> what version of batteries?
<ro_> 1.5
<ro_> (the one distributed with my gentoo)
<thelema_> I have a bad feeling you're not doing anything wrong, one sec
<ro_> Or with ocamlbuild and a _tags file: ocamlbuild -use-ocamlfind test.native
<thelema_> n/m, not that problem
<ro_> Error: No implementations provided for the following modules: BatNum referenced from test.cmx
<adrien_oww> add -linkpkg
<thelema_> adrien_oww: ocamlbuild should apply liknpkg already
<thelema_> *linkpkg
<ro_> Should I install batteries 2.0 ?
<adrien_oww> hmm, I shouldn't try to say anything when I don't even see right :P
<thelema_> ro_: yes, but I doubt it will fix your problem
<thelema_> ro_: the `ocamlfind ocamlc -package batteries -linkpkg test.ml` command compiles a trivial test.ml on my system that contains just "open BatNum"
<thelema_> ro_: can you test this on your system?
<ro_> Thank you, this works.
<thelema_> ok, now's the time to pastebin your code
<ro_> Ill take this as a starting point.
<thelema_> ok
<ro_> Sorry if this sounds really dumb, but what is wrong with this program: http://pastebin.com/GZN5UB4i
<thelema_> let _ = of_int 3;;
<thelema_> that's how I'd write it, but I think what you've written is allowed
<ro_> Thank you, but it does not solve my "Reference to undefined global BatNum" error
<thelema_> you're saying it works for you with just "open BatNum", but fails on this input file?
<ro_> Exactly.
<thelema_> odd. It works for me with batteries 2
jpdeplaix has quit [Quit: WeeChat 0.3.7]
<ro_> I've got exactly the same result with ocaml4 - batteries 1.5 on gentoo and ocaml 3.12 - batteries 1.4.3 on ubuntu
jpdeplaix has joined #ocaml
<ro_> I'll try with batteries 2 and let you know what happens :)
<thelema_> It's possible there's a problem with batteries 1.5's num; there's been a few problems found with it
jpdeplaix has quit [Client Quit]
jpdeplaix has joined #ocaml
thomasga has joined #ocaml
<ro_> No problem with batteries 2
yacks has quit [Quit: Leaving]
<thelema_> I guess there is a problem with batNum in 1.5; I'll have to release new version to fix this
Snark has quit [Quit: Quitte]
<ro_> I think it also exists in 1.4, since that's what I have
<ro_> (on the Ubuntu machine)
<thelema_> yes, <=1.5
<ro_> Thank you for your precious help, I would have given up long before if it wasn't for you.
<ro_> thelema_, is the only way to build BatNum's from strings representing floating point values to use of_float (float_of_string value) ?
<thelema_> num_of_string exists, but is deprecated
<thelema_> val of_string : string -> num
<thelema_> hmm, I guess it only works on integer values
<ro_> thelema_, I've seen this function, but it seems to accpet only integer and ratio representations.;
<thelema_> If you write a function to take a float string, split it on the decimal point, and compute the rat from the two halves, I'll add it to batteries
ottbot has joined #ocaml
<thelema_> i.e. iprt.fprt -> iprt + (fprt/10^(length fprt))
_andre has quit [Quit: leaving]
<ro_> Challenge accepted
ski has quit [Ping timeout: 245 seconds]
ski has joined #ocaml
lusory has quit [Ping timeout: 255 seconds]
ontologiae has joined #ocaml
lusory has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
mcclurmc has quit [Ping timeout: 252 seconds]
ftrvxmtrx has quit [Read error: Operation timed out]
ftrvxmtrx has joined #ocaml
thomasga has quit [Quit: Leaving.]
Cyanure has quit [Read error: Connection reset by peer]
Cyanure has joined #ocaml
AltGr has quit [Quit: Konversation terminated!]
ttamttam has left #ocaml []
mcclurmc has joined #ocaml
<ro_> thelema_, It took me a long time, but it was a fun exercise
<ro_> However, I think my code is beyond ugly
<thelema_> ro_: that is fixable
<ro_> Would you mind reviewing it for me ?
<thelema_> not at all
<ro_> First: is the pattern-matching a good way of achieving what I wanted ?
<ro_> Second: is there any way to avoid building so much strings to convert them back to ratios ?
<ro_> Third: where should I look at for a good formatting guide ?
<thelema_> pattern matching is generally good
<thelema_> hard to overuse
<thelema_> and yes, you can improve this code
<ro_> Fourth: is there a power operator for integers ?
<thelema_> in batteries, yes
<thelema_> val pow : int -> int -> int
<thelema_> In BatInt
<thelema_> but you don't want that, you want pow for Num
<thelema_> val pow : num -> num -> num
<ro_> Is there an "apply" function ? For example, I might be tempted to use something like that : apply BatNum.pow (List.map BatNum.from_int [10; String.length fprt_str])
<thelema_> eww
<orbitz> ro_: that woudln't make much sense in Ocaml
<orbitz> Why don't you jsut d oBatNum.pow ...?
<thelema_> BatNum.pow (BatNum.from_int 10) (BatNum.from_int (String.length fprt_str))
<ro_> That was only to avoid the repeaded "BatNum.from_int"
<ro_> I'm trying to discover what may or may not idiomatic, I just hope I didn't make your eyes bleed.
<orbitz> it's not that bad
<thelema_> how about something like that?
<thelema_> modulo the typo(s)
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<flux> actually doesn't batteries have a fold function that works almost like that..
<thelema_> flux: ah, you mean 'reduce'?
<flux> yeah
Submarine has quit [Quit: Leaving]
<thelema_> yes, that could substitute for the apply
<thelema_> but please no.
<flux> :)
<ro_> Out of curiosity, why no ?
<thelema_> applying reduce to a fixed 2-element list is just confusing to me.
<orbitz> the type system can't have a generic apply for the most part
<ro_> Ok.
<thelema_> and maybe the fact that pow isn't associative is also a problem...
<ro_> I was confused at first by the split function returning a 2-elements tuple, but was it build like that for ease of use in recursing functions ?
<thelema_> I don't know what it was built like that; most of the time, I prefer to reach for String.nsplit, which returns a list
<thelema_> but in this case, string.split is quite appropriate
<ro_> Thank you all (especially thelema_ ) for your time, I feel like I learnt quite a few things tonight.
Cyanure has quit [Remote host closed the connection]
<thelema_> you're welcome.
<thelema_> If you want credit for the function in the git commit, send me your name and email
Cyanure has joined #ocaml
<orbitz> Anyone read Harrison's book on logic/autoamted reasoning?
gnuvince has joined #ocaml
Arsenik has joined #ocaml
Cyanure has quit [Read error: Connection reset by peer]
gour has quit [Quit: WeeChat 0.3.9.2]
travisbrady has quit [Quit: travisbrady]
thomasga has joined #ocaml
travisbrady has joined #ocaml
chambart has joined #ocaml
andreypopp has quit [Quit: sleep]
answer_42 has quit [Remote host closed the connection]
Arsenik has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 256 seconds]
osa1 has quit [Quit: Konversation terminated!]
ahokaomaeha has joined #ocaml
mcsquiggedy has quit [Ping timeout: 252 seconds]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
ahokaomaeha has joined #ocaml
emmanuelux has joined #ocaml
mcsquiggedy has joined #ocaml
RagingDave has quit [Quit: Ex-Chat]
paintcan has quit [Quit: dd]
nimred has quit [Ping timeout: 256 seconds]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
adotbrown has joined #ocaml
LukeSun has joined #ocaml
tane has quit [Quit: Verlassend]
LukeSun has left #ocaml []
smondet has quit [Ping timeout: 255 seconds]
LukeSun has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.9.2]
chambart has quit [Ping timeout: 246 seconds]
ontologiae has quit [Ping timeout: 245 seconds]
tac is now known as tac-tics
LukeSun has quit [Ping timeout: 256 seconds]
jamii has quit [Quit: Leaving]
LukeSun has joined #ocaml
darkf has joined #ocaml
tac-tics has quit [Ping timeout: 245 seconds]
dskippy has joined #ocaml
<dskippy> Can anyone recommend any good 2D graphics libraries?
q66 has quit [Quit: Quit]
thomasga has quit [Quit: Leaving.]
bholst has joined #ocaml
cyball has quit [Remote host closed the connection]
nickmeharry has quit [Quit: leaving]
dskippy has left #ocaml []
dwmw2 is now known as dwmw2_gone
leoncamel has quit [Ping timeout: 252 seconds]
travisbrady has quit [Quit: travisbrady]
groovy2shoes has joined #ocaml