adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
damason has quit [Ping timeout: 250 seconds]
damason has joined #ocaml
orbifx has quit [Remote host closed the connection]
emaphis has quit [Ping timeout: 250 seconds]
madroach has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
python476 has joined #ocaml
blik71 has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
carts has joined #ocaml
<carts> Cannot find file topfind when executing ocaml foo.ml, contains #use "topfind", echo $OCAML_TOPLEVEL_PATH=/home/me/.opam/system/lib/toplevel
rgrinberg has joined #ocaml
ivan\ has quit [Ping timeout: 246 seconds]
<vishesh> I just installed jane street core. repl and utop work fine, but when I execute my script I get "unbound module Core"
<ygrek_> you need to bind core tightly
<ygrek_> otherwise it gets wild
igoroliveira has quit [Quit: Connection closed for inactivity]
carts has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #ocaml
echo-area has joined #ocaml
swgillespie has joined #ocaml
<vishesh> ygrek_: How do I do that? I kind of going crazy here. Followed the instructions in docs
<vishesh> So if do this "ocamlfind ocamlopt -linkpkg -thread -package core test.ml -o test" I could compile and run. Anyway I can just do "ocaml test.ml"?
superboum_ has quit [Ping timeout: 252 seconds]
<ygrek_> #require "core"
tmtwd has joined #ocaml
damason has quit [Ping timeout: 276 seconds]
damason_afk has joined #ocaml
<vishesh> ygrek_: Thanks, ocamlscript looks good for now.
ncthom91 has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AltGr has joined #ocaml
ynniv has joined #ocaml
<ynniv> None of the up to date tuareg packages contain tuareg-imenu. Is this no longer supported? Am I supposed to manage the source file myself?
ril has joined #ocaml
ril has quit [Client Quit]
ncthom91 has joined #ocaml
ril has joined #ocaml
jeffmo has quit [Quit: jeffmo]
emaphis has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
damason_afk has quit [Ping timeout: 250 seconds]
damason has joined #ocaml
ynniv has quit [Quit: ynniv]
python476 has left #ocaml [#ocaml]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ril has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
damason has quit [Ping timeout: 240 seconds]
ril has quit [Client Quit]
Bahman has joined #ocaml
ygrek_ has quit [Ping timeout: 265 seconds]
darkf has joined #ocaml
mac10688 has quit [Ping timeout: 255 seconds]
ril has joined #ocaml
python476 has joined #ocaml
ril is now known as ril[away]
ril[away] is now known as ril
vpm has quit [Ping timeout: 260 seconds]
kushal has joined #ocaml
zaquest has quit [Ping timeout: 264 seconds]
nopf has quit [Remote host closed the connection]
damason has joined #ocaml
zaquest has joined #ocaml
emaphis has quit [Ping timeout: 260 seconds]
tmtwd has quit [Ping timeout: 240 seconds]
rgrinberg1 has joined #ocaml
darkf_ has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
metadave has quit [Ping timeout: 240 seconds]
metadave has joined #ocaml
darkf has quit [Ping timeout: 240 seconds]
ril is now known as ril[away]
ril[away] is now known as ril
tmtwd has joined #ocaml
darkf_ is now known as darkf
ivan\ has joined #ocaml
manizzle has quit [Ping timeout: 272 seconds]
tmtwd has quit [Ping timeout: 276 seconds]
pierpa has quit [Ping timeout: 240 seconds]
AltGr has left #ocaml [#ocaml]
Bahman has quit [Read error: Connection reset by peer]
Bahman has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg1 has quit [Ping timeout: 272 seconds]
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 250 seconds]
IbnFirnas has quit [Ping timeout: 244 seconds]
zpe has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
swgillespie has quit [Ping timeout: 250 seconds]
wagle has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
nchambers is now known as dts|pokeball
wagle has joined #ocaml
IbnFirnas has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
Haudegen has joined #ocaml
igstan has joined #ocaml
freehck has joined #ocaml
ely-se has joined #ocaml
mort___ has quit [Quit: Leaving.]
AltGr has joined #ocaml
AltGr has left #ocaml [#ocaml]
rgrinberg1 has joined #ocaml
ollehar has joined #ocaml
solrize has joined #ocaml
kdas_ has joined #ocaml
<solrize> hi, can someone give me ocaml code to count to a billion? for this microbenchmark: http://wingolog.org/archives/2013/11/26/a-register-vm-for-guile#22eb29cc4718732690773b434fadcdc9499c3f20
kushal has quit [Ping timeout: 265 seconds]
ygrek_ has joined #ocaml
govg has quit [Ping timeout: 265 seconds]
rgrinberg1 has quit [Ping timeout: 260 seconds]
tibor_ has joined #ocaml
MercurialAlchemi has joined #ocaml
<freehck> Ha. )
<freehck> No problems
<solrize> thanks
<solrize> ghc -O2 takes about 7 sec on a fast x86
<solrize> i will try with unboxed integers
<flux> so did you get a program?
<solrize> ocaml? not yet, i thought freehck was writing one
Fleurety has joined #ocaml
ollehar has quit [Remote host closed the connection]
<freehck> solrize: let x = ref 0 in while !x < 1000000000 do x := !x+1 done;;
<solrize> thanks
<solrize> 0.522 sec, hah
<solrize> wow
<companion_cube> for i=0 to 1_000_000_000 do () done
<companion_cube> without the reference
<flux> for-loop is indeed faster :-)
<solrize> oh thanks, yeah, that's more idiomatic
<solrize> hmm
<solrize> what's the closest thing to the scheme code style-wise?
<solrize> 0.261 sec for the for loop
<solrize> wait that's suspicious, i'm on a 3.4 ghz machine
<solrize> i ought to learn ocaml though, i've liked most of what i've seen about it
<solrize> thanks guys
<freehck> solrize: it could be a bad comparision. your scheme code (I mean guile) is a tail-recursive one. And both of above examples are imperative.
<solrize> freehck, can you do a tail recursive one? the guile code was written by andy btw
<solrize> i ran it on the arm box where it took something like 35 minutes because 1 billion is a bignum on a 32 bit guile
<solrize> which uses 3 tag bits
<solrize> no wait, 2 tag bits and a sign
<companion_cube> let () = let rec iter_to i j = if i<j then iter_to (i+1) j in iter_to 0 1_000_000_000
<freehck> let test = let rec count x = if x < 1_000_000_000 then count (succ x) in count 1;;
<solrize> freehck, 0.518 sec, just like the while loop
<companion_cube> we shoudl test with flambda, too
<solrize> companion_cube, about the same
<freehck> solrize: expected.
<companion_cube> I'm pleasantly surprised by the tailrec function
<companion_cube> but I guess it's compiled almost the same as the for loop
<flux> I guess the reasonable thing would be to look at the assembler and see if it has any obvious inefficiencies ;-)
<solrize> andy's guile code under guile 2.0 = 13 sec
<solrize> 13.9 actually
<freehck> solrize: blame to run-time type checking? )
<solrize> freehck, no that's with the old stack vm
<solrize> 2.2 is about 2x faster and it's still a bytecode interpreter
<solrize> but it's a lua-like register vm
<freehck> I'd be interested if you tried also Racket Scheme and Haskell for this benchmark.
<solrize> i did haskell, about 8 sec
<solrize> that was with a dumb tail recursive loop
<freehck> 8 sec? Can't be true. Could I look at the code?
<freehck> All the benchmarks show that Haskell's performance is at the level of ocaml. And 8 seconds...
<solrize> lemme try with int instead of integer
<solrize> 0.521 sec
<solrize> yeah the 8 sec was because it was using bignums
<solrize> which makes me ask what ocaml was doing
<solrize> see annotation
<freehck> solrize: In the examples you were provided Ocaml just iterated a loop. It's the same. Except of printing.
<freehck> But Haskell needs it because of lazyness: it won't do anything until you need it for some operation.
<solrize> yeah, the seq annotation forces the arithmetic
<solrize> but did ocaml use a machine int or a bignum?
<companion_cube> it uses a 63-bits machine num
<solrize> ic
<solrize> yeah that would do it
<freehck> int - 1 bit.
<companion_cube> 1 bit is reserved for a tag, for the GC
<solrize> the 8 sec haskell used a bignum
<solrize> http://lpaste.net/4832750020967006208 hmm using unboxed arithmetic still took 0.5 sec
<freehck> solrize: time racket -e '(let loop ((x 1)) (when (< x 1000000000) (loop (+ x 1))))'
<freehck> I have 1,735 sec but it's better to run on your machine.
<solrize> time apt-get install racket
<freehck> )))
<solrize> installing 242 meg...
<solrize> 18 sec not bad
<freehck> solrize: debian rules? )
<solrize> user0m2.336s
badon has joined #ocaml
<solrize> 2.36 sec
<solrize> freehck i'm trying to figure out how to switch to guix :)
<freehck> I'm thinking about Debian GNU/Hurd.
<freehck> At least it won't run Steam! :)
<solrize> haha
<freehck> It's important for such a gamer like me. :)
<solrize> yeah that's interesting
<solrize> i wonder if there will be a guixsd/hurd distro
<solrize> my other server is a scaleway arm7
<solrize> and there's no guixsd for that yet
<reynir> 11.4 secs with zarith: http://paste.reyn.ir/1
<solrize> what's that?
<freehck> Zarith? Wtf is it? )
<solrize> yeah
<reynir> zarith is a bignum library
<freehck> It's an ocaml module?
<solrize> it uses gmp ?
<reynir> Yes
<freehck> gotcha
<solrize> does ocaml not have built in bignums?
<reynir> it does, but zarith is faster :)
<solrize> almost everything else has it these days
<solrize> aha :)
<freehck> ha! :)
<solrize> try with regular bignums?
<freehck> Big_int module.
ollehar has joined #ocaml
<solrize> ok
<freehck> Didn't even know that Ocaml works with Bigints. :)
<freehck> I mean out of box.
Kakadu has joined #ocaml
<freehck> solrize: btw about guix...
<freehck> 12:04 <python476> "phase `build' failed after 8601.6 seconds"
<freehck> 12:04 <python476> guix's way of greeting people
ely-se has quit [Quit: leaving]
<solrize> haha
<freehck> channel #emacs :)
<solrize> it took 7 hours to build guile on the arm server
<freehck> cross-compilations is for lazy people? )
<freehck> solrize: use distcc, luke.
<solrize> well i started it going and after 15 minutes or so i thought it was looping and went on the guile channel and was told it would take 7 hours
<reynir> Hm, there's a Z.equal. Dunno if I should've used that instead
<solrize> what good is having a dedicated server if i'm not gonna do long compiles? :)
ely-se has joined #ocaml
<freehck> "I'm not gonna do long compiles" <> "it took 7 hours to build guile on the arm server" :)
<freehck> btw it's an interesting result that luajit was faster than racket...
<solrize> racket should also have used bignums unless you did something to prevent it
ollehar has left #ocaml [#ocaml]
<solrize> but yeah luajit is amazing
<solrize> if you look at alioth shootout it's almost as fast as c a lot of the time
<reynir> 1m23s with Big_inthttp://paste.reyn.ir/2
<solrize> anyway i gotta go to bed, it's late here
<solrize> yikes :)
<reynir> *Big_int http://paste.reyn.ir/2
<companion_cube> reynir: try with Zarith
* reynir goes into an infinite loop
<solrize> haha
<solrize> companion_cube, scroll back :)
<companion_cube> I just see big_int
<solrize> <reynir> 11.4 secs with zarith: http://paste.reyn.ir/1
<reynir> companion_cube: I first tried with zarith :)
<solrize> ok gnite everyone, i'll post some of these timings to andy's blog tomorrow if i remember to
<solrize> thanks
<companion_cube> oh sorry
<companion_cube> 11s, ok
<companion_cube> not bad
<freehck> solrize: good night
<freehck> people, btw, who's andy? )
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 246 seconds]
mort___ has joined #ocaml
igstan has quit [Quit: igstan]
Bahman has quit [Read error: Connection reset by peer]
Bahman has joined #ocaml
kdas_ has quit [Quit: Leaving]
kushal has joined #ocaml
<Mike57_> Is there a way to set a #trace in a recursive *inner* function?
<Mike57_> or do I have to break it out to the top level>
<Mike57_> or do I have to break it out to the top level?
rgrinberg1 has joined #ocaml
<companion_cube> you probably have to lift it out to the toplevel
rgrinberg1 has quit [Ping timeout: 246 seconds]
kushal has quit [Quit: Leaving]
python476 has quit [Ping timeout: 246 seconds]
<Mike57_> Thanks: that's what I thought, but just wondered it there a trick I didn't know about
echo-area has quit [Remote host closed the connection]
accname has joined #ocaml
<accname> hi
jonludlam has joined #ocaml
kushal has joined #ocaml
<accname> can someone help me with a little problem?
python476 has joined #ocaml
Simn has joined #ocaml
<ely-se> accname: not yet, you first have to state the problem.
<accname> :) of course
<accname> well basically I am working with hol light. to use it I have to use it via #use "hol.ml"
<accname> the problem is that I changed some code and it produces errors. To investigate what the errors are I would like to print the output of #use into a file
<accname> is that possible?
igstan has joined #ocaml
<fds> freehck: I assume solrize means Andy Wingo of Guile fame.
libertas_ has joined #ocaml
<fds> That could obviously be an faulty assumption, mind.
Bahman has quit [Quit: Ave atque vale]
libertas has joined #ocaml
libertas_ has left #ocaml [#ocaml]
mort___ has left #ocaml [#ocaml]
jgjl has joined #ocaml
mtesseract has quit [Ping timeout: 240 seconds]
mtesseract has joined #ocaml
superboum_ has joined #ocaml
<freehck> fds: thank you
<freehck> btw, I've visited Andy Wingo weblog and found it has an ugly backgroud acid-red color. I could change it in CSS editor in Firefox, but of course changes are dropped after reloading page or following a link.
<freehck> Do somebody know how to make these changes persistent? :)
<freehck> I know it's out the scope of the channel but why not... :)
FreeBird_ has joined #ocaml
igstan has quit [Quit: igstan]
FreeBirdLjj has quit [Ping timeout: 250 seconds]
FreeBird_ has quit [Ping timeout: 240 seconds]
mort___ has joined #ocaml
<freehck> Well, Stylish addon is what has solved that problem. :)
<companion_cube> accname: good question
<companion_cube> can you write into foo.ml #use "hol.ml", then run ocaml foo.ml > log_file ?
netrobyatmobile has joined #ocaml
ia0 has quit [Quit: leaving]
ia0 has joined #ocaml
<accname> I'll try that. I forgot to mention that I am using "rlwrap ocaml"
<companion_cube> this is just for runnign the script non interactively, so don't use rlwrap there
<accname> nah doesn't work. Syntax error for the > symbil
<accname> nah doesn't work. Syntax error for the > symbol
<companion_cube> ocaml file.ml > something? it's standard bash
<companion_cube> sh, even
<accname> I got it
<accname> ocaml file.ml > output.txt
<accname> :D
<accname> that does work, didnt think about that
<companion_cube> yes
<accname> thank you
<companion_cube> you're welcome :)
<freehck> accname: Could I alse advice you to use merlin editor? It's very powerful.
<freehck> *also
<companion_cube> but it's not necessarily easy to use with HOL
<companion_cube> since HOL is meant to be used within a toplevel
ygrek_ has quit [Ping timeout: 240 seconds]
<freehck> aah, HOL Light... I missed this.
<accname> :) I was about to look at merlin
<accname> but thanks for mentioning I will still look at it
sgnb has joined #ocaml
accname has quit [Ping timeout: 246 seconds]
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
bjorkintosh has quit [Quit: Leaving]
<freehck> Does somebody know where ocaml looks for modules by default?
<freehck> I need to pack an rpm of the upstream ocaml for our project, and need to build some modules.
<freehck> And the real question is: how to build them without opam, and where to put them after build?
grouzen has joined #ocaml
superboum_ has quit [Ping timeout: 240 seconds]
bjorkintosh has joined #ocaml
sepp2k has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
igstan has joined #ocaml
Haudegen has joined #ocaml
<sgnb> freehck: `ocamlc -where`
nopf has joined #ocaml
<freehck> sgnb: hm... and could it be changed?
<freehck> is it decided while building ocaml or with some kind of config?
<reynir> freehck: maybe this is helpful (I didn't read it) https://fedoraproject.org/wiki/Packaging:OCaml?rd=Packaging/OCaml
igoroliveira has joined #ocaml
igstan has quit [Quit: igstan]
igstan has joined #ocaml
BitPuffin has joined #ocaml
ely-se has quit [Quit: leaving]
<freehck> I've looked through debian ocaml package sources and realized that there's the -libdir option for configure. :)
accname has joined #ocaml
rand has joined #ocaml
ely-se has joined #ocaml
mv has quit [Ping timeout: 246 seconds]
tg has quit [Ping timeout: 246 seconds]
Haudegen has quit [Ping timeout: 265 seconds]
<ely-se> why does it pick u instead of failing with an ambiguity error?
tg has joined #ocaml
<freehck> ely-se: the same thing will happen if you do "type thing = string";;
<freehck> all the strings you create after this will be tracted as having thing type.
<freehck> I think it's not an error. It's just a type redefinition.
<ely-se> oh ok
<ely-se> so t and u are the same thing
<freehck> Yep, they can be used in place of each other. I tested it with strings but I'm pretty sure it should be for such types too.
Haudegen has joined #ocaml
<ely-se> then why can't you just write { a = 1, b = 2 } without type definitions in scope?
<freehck> s/,/;/
<ely-se> yeah
<freehck> The type should have a name, isn't it?
ryanartecona has joined #ocaml
<ely-se> it says "Error: Unbound record field a" but since apparently record types are structural I don't see why this should be forbidden
<freehck> This error message hardly correlate to the real reasons of error happen. But usually when you're coding not in the toplevel the compiler can evaluate the type of structure you really need and provide you with more useful message.
<freehck> For example: "Some record fields are undefined: nodev"
<freehck> The error message you get is caused by the information leak about the type you should get after evaluating the code in the toplevel. So it suppose that it should be a structure, and I can only assume that it suppose this structure to have no fields.
<freehck> ely-se: I don't really sure about the word "leak".
<freehck> I wanted to have a sense of "not enough of"
<freehck> *I'm not really sure
igstan has quit [Quit: igstan]
<freehck> aaah. My english hambles sometimes.
igstan has joined #ocaml
Haudegen has quit [*.net *.split]
metadave has quit [*.net *.split]
sivoais has quit [*.net *.split]
<freehck> Wow. The changelog for Ocaml Debian package has commits signed by Stefano Zacchiroli. :)
<flux> no, t and u aren't the same thing in ely-se's example
<flux> and records are not structurally typed in ocaml, only modules and objects are
<flux> and I suppose in some sense polymorphic variants?
Haudegen has joined #ocaml
metadave has joined #ocaml
sivoais has joined #ocaml
sivoais has quit [Max SendQ exceeded]
sivoais has joined #ocaml
<freehck> Hm... I have mistaken.
<flux> easy way to see it: type t = { a : int } let a = { a = 42 } type u = { a : int } let _ = a = { a = 42 }
<freehck> type x = {x:int};;
<freehck> type y = {x:int};;
<freehck> let v : x ref = ref {x=1};;
<freehck> -> Error: This expression has type y ref but an expression was expected of type x ref
<freehck> -> Type y is not compatible with type x
<flux> but, ocaml has this new cool feature to somewhat help with dealing with the accidental redefinitions
<flux> let _ = a = ({a = 42} : t) maybe works :)
<freehck> flux: but why does it work for strings?
<freehck> type the_string = string;;
<freehck> print_endline "123";;
<flux> that's just a type alias
<freehck> aaaah...
<flux> but { } defines a new record type
<flux> I suppose you could say t is an alias to the new record type, but the record type nevertheles is a new type
emaphis has joined #ocaml
<flux> and you can only define new record types with type t = { .. } syntax :)
badon has quit [Ping timeout: 264 seconds]
<freehck> flux: but why records of the same fields are considered as different?
<flux> well, why would you have them in the first place?
<flux> btw, you can type: type u = t = { x : int }
<ely-se> flux: ok I understand!
<freehck> I dunno.
<freehck> I think I actually don't need them.
ncthom91 has joined #ocaml
<freehck> Okay, it's simpler and more safe to separate them of course.
badon has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 264 seconds]
python476 has quit [Ping timeout: 246 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ely-se has quit [Quit: leaving]
zoetus has joined #ocaml
<zoetus> hello everyone!
<zoetus> do people here use oasis for builds?
<zoetus> i seem to have confused it such that it refuses to build my project
ryanartecona has quit [Quit: ryanartecona]
lopex has joined #ocaml
<companion_cube> zoetus: can you give more details?
<zoetus> sure: i get this message "The file 'btc/src/META' generated for the library 'btc_support' is already used for the library 'btc_targets'"
<zoetus> i'm confused because this META file does not even exist
<zoetus> previously, btc_support and btc_targets were libraries with a common FindLibParent
<companion_cube> it might be in _build/btc/src/META
<zoetus> but i changed my _oasis file so that they are separate
<companion_cube> oasis relies on ocamlbuild
<companion_cube> well, first, rm -rf _build
<companion_cube> there might be leftovers
<zoetus> i looked there, but nothing
<zoetus> find . -name "META" gets nothing :(
<zoetus> ok, i blew away the _build directory, same error
<companion_cube> and you ran oasis setup again? or are you using the dynamic stuff?
<zoetus> i was, yeah
<companion_cube> hmm :s
<companion_cube> can I see the _oasis file? if it's on the web?
<zoetus> it doesn't matter what i do, `oasis setup -setup-update {dynamic|weak}` both give me the same error
<zoetus> sure, hang on
ely-se has joined #ocaml
jeffmo has joined #ocaml
vpm has joined #ocaml
<zoetus> oops, that was an outdated version -- updated now
<companion_cube> oh ok, don't put two sublibraries in the same directory
<companion_cube> because oasis will confuse them (too general _tags files)
<companion_cube> so _targets and _support are in the same dir but have distinct dependencies, that will not do
<zoetus> yeah :(
<zoetus> ah, so moving support into a subdirectory seems to have had some effect: now i get the same error, but the conflict seems to be between btc_core and btc_targets
<zoetus> probably for the same reason
<companion_cube> I saw the old version (before you updated the gist) and every sublib/binary was in its own directory
ggole has joined #ocaml
<zoetus> those libraries actually are in the same directory, i think the only difference is that i'm using FindLibName/Parent
tmtwd has joined #ocaml
<zoetus> awesome! that fixed it! thank you so much!
<zoetus> i do have another question that's (i think) unrelated to my lack of oasis understanding
<zoetus> i recently updated my ocaml compiler to 4.2.3, and now when i build anything i get the following warning (several times):
<zoetus> findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /usr/local/lib/ocaml/compiler-libs, /usr/local/lib/ocaml
<freehck> People, I have an argument with a colleage. It's about the coding style in ocaml. The question is what is better: to provide all the functions with types or to left it to time inference?
<companion_cube> zoetus: I have the same, sometimes; no idea why
<companion_cube> freehck: it's a matter of taste. My rule: I write a .mli file with types + doc for public functions
<freehck> I argue that it's better to left in to type inference, and specify types only in .mli files.
<companion_cube> private functions I don't usually annotate with types, except when they are really really complicated
<Drup> (or when you need too)
<companion_cube> (yes)
<companion_cube> (spéciale dédicasse GADTs)
<ely-se> I annotate all top-level bindings with types.
<zoetus> is there any way to get rid of that? it makes my builds really noisy
<zoetus> like, every invocation of ocamlfind gives me that warning
<zoetus> i also have issues that i wasn't seeing pre-upgrade, where names of modules in my project are clashing with ones in /usr/local/lib/ocaml/compiler-libs
ril has joined #ocaml
<freehck> ely-se: I'm sorry, but I can have a little misunderstanding what a top-level is. Is it a set of functions provided with .mli files?
<ely-se> sorry-module-level bindings
<ely-se> I don't know what the official term is
<freehck> thx.
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 240 seconds]
<zoetus> it is kind of a drag that i can't define a module named 'Env' because one with that name already exists in 'compiler-libs/ocamlcommon.cmxa'
<zoetus> ?
igstan has quit [Quit: igstan]
<zoetus> it's weird that that wasn't an issue before 4.2.3 also
<companion_cube> yeah, this is annoying
<companion_cube> the lack of namespace in general
michael_lee has joined #ocaml
grouzen has quit [Quit: Lost terminal]
<zoetus> especially if i'm writing a compiler, chances are i'm going to have a lot of name clashes
<Drup> zoetus: you can "solve" that with pack
<Drup> (also, the name classhes only if they are linked together, Env is only going to clash if you link to compiler-libs)
<companion_cube> that still prevents you from loading your code in the toplevel
<Drup> oh, right
ryanartecona has joined #ocaml
<zoetus> hmm, i don't see where i'm doing that
<zoetus> i mean linking to compiler-libs
rgrinberg1 has joined #ocaml
dts|pokeball is now known as nchambers
FreeBirdLjj has joined #ocaml
<zoetus> is there some way in the 'opam' file to require a base version of ocaml for my package?
<def`> available: [ocaml-version >= "4.00.0"]
ryanartecona has quit [Quit: ryanartecona]
accname has quit [Ping timeout: 246 seconds]
darkf_ is now known as darkf
yomimono has joined #ocaml
BitPuffin has quit [Read error: Connection reset by peer]
netrobyatmobile has quit [Quit: Connection closed for inactivity]
groovy2shoes has joined #ocaml
slash^ has joined #ocaml
BitPuffin has joined #ocaml
igoroliveira_ has joined #ocaml
jeroud_ has joined #ocaml
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
stomp_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
kdas_ has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
drmem has joined #ocaml
raphaelsss has joined #ocaml
RichN has quit [Ping timeout: 240 seconds]
stomp has quit [Ping timeout: 240 seconds]
kushal has quit [Ping timeout: 240 seconds]
schoppenhauer has quit [Ping timeout: 240 seconds]
jeroud has quit [Ping timeout: 240 seconds]
Maelan has quit [Ping timeout: 240 seconds]
igoroliveira has quit [Ping timeout: 240 seconds]
andreypopp has quit [Ping timeout: 240 seconds]
luzie has quit [Ping timeout: 240 seconds]
tobiasBora has quit [Ping timeout: 240 seconds]
fold1 has quit [Ping timeout: 240 seconds]
jeroud_ is now known as jeroud
igoroliveira_ is now known as igoroliveira
tobiasBora has joined #ocaml
fold2 has joined #ocaml
raphaelss has quit [Ping timeout: 246 seconds]
andreypopp has joined #ocaml
rgrinberg1 has quit [Ping timeout: 265 seconds]
ril has joined #ocaml
luzie has joined #ocaml
Maelan has joined #ocaml
FreeBirdLjj has joined #ocaml
schoppenhauer has joined #ocaml
raphaelssss has joined #ocaml
ely-se has quit [Quit: leaving]
raphaelsss has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
jabesed has joined #ocaml
rgrinberg1 has joined #ocaml
zpe has quit [Remote host closed the connection]
ollehar has quit [Remote host closed the connection]
yomimono has quit [Ping timeout: 276 seconds]
ryanartecona has joined #ocaml
groovy3shoes has joined #ocaml
groovy2shoes has quit [Disconnected by services]
groovy3shoes is now known as groovy2shoes
t4nk538 has joined #ocaml
lukky513 has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
troydm has joined #ocaml
^elyse^ has joined #ocaml
kdas_ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
rgrinberg1 has quit [Ping timeout: 240 seconds]
Kakadu has quit [Ping timeout: 246 seconds]
<t4nk538> I've not had time to experiment, but if anyone knows the answer, please enlighten me. If I write a module using core's async and now I want to use it from another module that has been written using Lwt, would that work? Would there be any performance or other issues? I fear I'm screwed.
<companion_cube> I'm afraid Async and Lwt don't play together well
jwatzman|work has joined #ocaml
Kakadu has joined #ocaml
sgnb has quit [Ping timeout: 240 seconds]
<flux> some effort was for writing a common interface for them, but apparently they are so subtly different that it turned out difficult..
tane has joined #ocaml
libertas has quit [Ping timeout: 272 seconds]
sgnb has joined #ocaml
jonludlam has quit [Ping timeout: 260 seconds]
pacmann has joined #ocaml
python476 has joined #ocaml
jabesed has quit [Ping timeout: 240 seconds]
NingaLeaf has joined #ocaml
darkf has quit [Quit: Leaving]
orbifx has joined #ocaml
python476 has quit [Quit: Page closed]
<NingaLeaf> Is there a way to increment a ref variable within an Array.iter? - ex. Array.iter (fun x -> Printf.printf "[%i] %s\n" (incr c) x) a => Error: This expression has type unit but an expression was expected of type.
<companion_cube> what is c?
<NingaLeaf> let c = ref 0
<companion_cube> and a : string array?
<companion_cube> (fun x -> sprintf "[%i] %s\n" !c x; incr c)
<NingaLeaf> let check_input = let c = ref 0 in let a = Sys.argv in
<NingaLeaf> ;;
<NingaLeaf> Array.iter (fun x -> Printf.printf "[%i] %s\n" (incr !c) x) a
Kakadu has quit [Quit: Page closed]
ril is now known as ril[away]
python476 has joined #ocaml
<companion_cube> yeah well, try what I wrote above
<NingaLeaf> yes this worked!
<NingaLeaf> thank you!
<flux> I suppose if you want to be complicated, printf "%i" (incr c; !c) works as well :-)
<companion_cube> heh
<companion_cube> not the same !!
psy_ has quit [Ping timeout: 250 seconds]
<companion_cube> (let x = !c in incr c; x) would work
ril[away] is now known as ril
ggole has quit []
ryanartecona has quit [Quit: ryanartecona]
^elyse^ has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 272 seconds]
madroach has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
madroach has joined #ocaml
^elyse^ has joined #ocaml
zpe has joined #ocaml
rand has quit [Quit: leaving]
<sgeisenh> How come nobody suggested iteri?
<sgeisenh> let check_input =
<sgeisenh> let a = Sys.argv in
<flux> well, it's probably more important to learn how that was built with incr without using Array.iteri than just use it for this particular problem :)
yomimono has joined #ocaml
<sgeisenh> refs are ugly and I like to keep my benign effects hidden away
pierpa has joined #ocaml
octachron has joined #ocaml
michael_lee has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
pierpa has quit [Remote host closed the connection]
pierpa has joined #ocaml
psy_ has joined #ocaml
python476 has quit [Ping timeout: 246 seconds]
yomimono has quit [Ping timeout: 240 seconds]
Hetu has joined #ocaml
ocaml320 has joined #ocaml
Kakadu has joined #ocaml
ocaml320 has quit [Client Quit]
<mrvn> ups
ryanartecona has joined #ocaml
<orbitz> Hello, if I have two types, a and b, how can I say that i don't care what a and b are, but a must be a subtype of b?
lobo has joined #ocaml
ncthom91 has joined #ocaml
Hetu has quit [Ping timeout: 264 seconds]
Hetu has joined #ocaml
tane has quit [Ping timeout: 250 seconds]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<companion_cube> orbitz: can't do, I think
orbifx has quit [Ping timeout: 276 seconds]
kushal has quit [Quit: Leaving]
slash^ has quit [Read error: Connection reset by peer]
<orbitz> dang
uggwar has quit [Ping timeout: 240 seconds]
BitPuffin has quit [Ping timeout: 276 seconds]
ryanartecona has quit [Read error: No route to host]
ril has joined #ocaml
zoetus has quit [Ping timeout: 246 seconds]
tane has joined #ocaml
rgrinberg1 has joined #ocaml
raphaelssss has quit [Ping timeout: 272 seconds]
ryanartecona has joined #ocaml
rgrinberg1 has quit [Ping timeout: 272 seconds]
ygrek_ has joined #ocaml
freehck has quit [Remote host closed the connection]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
t4nk538 has quit []
badon has quit [Ping timeout: 272 seconds]
Hetu has quit [Quit: Verlassend]
ollehar has joined #ocaml
ceryo has joined #ocaml
badon has joined #ocaml
ygrek_ has quit [Remote host closed the connection]
ygrek has joined #ocaml
octachron has quit [Quit: Leaving]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ril has joined #ocaml
ceryo_ has joined #ocaml
ceryo has quit [Ping timeout: 260 seconds]
Guest38 has joined #ocaml
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 264 seconds]
ryanartecona has quit [Quit: ryanartecona]
Algebr has joined #ocaml
ceryo_ has quit [Ping timeout: 264 seconds]
tani has joined #ocaml
zpe has quit [Remote host closed the connection]
tane has quit [Ping timeout: 240 seconds]
tani has quit [Ping timeout: 240 seconds]
^elyse^ has quit [Quit: Leaving]
bbc has quit [Ping timeout: 252 seconds]
emaphis has quit [Quit: by by]
mac10688 has joined #ocaml
ivan\ has quit [Ping timeout: 246 seconds]
ygrek has quit [Ping timeout: 250 seconds]
ivan\ has joined #ocaml
tane has joined #ocaml
ygrek has joined #ocaml
tane has quit [Ping timeout: 260 seconds]
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
bbc has joined #ocaml
tane has joined #ocaml
tane has quit [Remote host closed the connection]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zpe has joined #ocaml
jave_ has quit [Ping timeout: 240 seconds]
zpe has quit [Ping timeout: 244 seconds]
lobo has quit [Ping timeout: 260 seconds]
jave has joined #ocaml
Algebr has quit [Remote host closed the connection]
ncthom91 has joined #ocaml
jeffmo has quit [Quit: jeffmo]
Simn has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml