<companion_cube>
(also, "coucou" is the cuckoo bird)
<Algebr`>
oh
<companion_cube>
it's a children's song obviously :)
<freehck>
People, good question! Do somebody know how Core_list.reduce behaves with list of exactly one argument? :)
<freehck>
*with list of exactly one element? :)
<Algebr`>
look at the source, it will reveal all
<freehck>
List.reduce ~f:(+) [1];; --> 1
<freehck>
List.reduce ~f:(-) [1];; --> 1
<freehck>
Algebr`: yep, you're right. :)
<reynir>
I'm thinking it just returns the single element
pootler has quit [Ping timeout: 248 seconds]
<freehck>
do opam save sources somewhere so I can unpack them and learn the code?
<freehck>
Ah i see. repo/default/archives...
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dxtr>
What does 'int * tsring' mean?
<dxtr>
err
<dxtr>
int * string
<Algebr`>
a tuple where first thing is int, second thing is string
<freehck>
dxtr: returnes tuple
<dxtr>
Oh
<rightfold>
The type of such a tuple, rather
<reynir>
It's the type for a pair of int and string, e.g. (1, "two"). Or it's two badly named int-variables that are being multiplied :)
<dxtr>
Is it a stupid question to ask why the type is not simply (int, string)? :p
<rightfold>
Because (a, b) map would be a map from a to b
<rightfold>
This syntax is used for passing multiple type arguments
<freehck>
reynir: seems you to be right. It calls fold with hd as init value.
<freehck>
dxtr: it's a link to a cartesian product.
<reynir>
dxtr: not an answer, but in OCaml, »() : unit«
<freehck>
A*B is a set of all possible tuples which are (a,b) where a from A and b from B.
FreeBirdLjj has quit [Remote host closed the connection]
rpip has quit [Ping timeout: 248 seconds]
FreeBirdLjj has joined #ocaml
<Algebr`>
where's the /dev/null descriptor in unix module?
<Algebr`>
I don't care about stderr
<Algebr`>
or I guess I need to grab a handle myself....sigh
<freehck>
Algebr`: While stdout and stderr / stdin are always opened for any program, the /dev/null device could be not opened at all. So yes, you need to open it yourself.
<Algebr`>
I meant as a convience in unix module
<companion_cube>
hmm, maybe the bot could have a stackoverflow query command
nicoo has quit [Ping timeout: 268 seconds]
nicoo has joined #ocaml
<Drup>
!cube_bot
<Drup>
hum, the bot doesn't know himself
<companion_cube>
indeed
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_andre has joined #ocaml
zpe has joined #ocaml
cube_bot has quit [Remote host closed the connection]
<companion_cube>
yeah, well, everyone is waiting but there is no expected date
<chelfi>
it sounds a bit like wishful thinking
freehck has joined #ocaml
<chelfi>
I mean, everyone seems to agree modular implicits are cool, but AFAICT nobody is actively working on it at the moment
ayys has quit [Quit: Page closed]
zpe has quit [Remote host closed the connection]
<octachron>
companion_cube, moving iter.cmo before list.cmo in stdlib/Makefile.shared OTHERS variable and fixing stdlib/.depend seems to solve the build problem for me
kolko has quit [Read error: Connection reset by peer]
kolko has joined #ocaml
freusque has quit [Ping timeout: 250 seconds]
<companion_cube>
chelfi: I think def` is working on it
<companion_cube>
octachron: I'm trying it, thanks
freehck has quit [Quit: rcirc on GNU Emacs 24.4.1]
agarwal1975 has joined #ocaml
sh0t has joined #ocaml
ygrek has joined #ocaml
AlexRussia has joined #ocaml
fraggle-boate has quit [Remote host closed the connection]
fraggle-boate has joined #ocaml
copy` has joined #ocaml
freehck has joined #ocaml
<freehck>
Hello everyone.
ygrek has quit [Ping timeout: 265 seconds]
<zozozo>
hi
<freehck>
Do functor always need to have a module it's based on?
<freehck>
So the question is: do RWO need an update here?
<zozozo>
I think generative functors came after RWO was written
<Drup>
RWO is not the reference manual, I don't think it ever aimed at covering the whole language in all the details
ygrek has joined #ocaml
Algebr` has quit [Ping timeout: 244 seconds]
<freehck>
Btw, isn't it bad to make such abstractions like I made in that snippet? Well, I know that functor application is a runtime event, so how about performance of such abstractions in a real program?
<ggole>
You can probably make it a bit cheaper if you're willing to use %identity
MercurialAlchemi has quit [Ping timeout: 276 seconds]
<freehck>
ggole: well the question is how much it costs. I just don't know.
<Drup>
freehck: one function application, at the beginning of your program
<ggole>
You can also use private types and coercions instead of from_string
<Drup>
so, inconsequential
<Drup>
ggole: I fail to see how %identity would help you.
<ggole>
Because it would guarantee that of_string was free?
<Drup>
don't do that, it's useles
<Drup>
even the old inliner was good enough to inline the identity function
<freehck>
ggole: doesn't ocamlopt remove such of_string calls while optimisation?
<freehck>
Of course it's not about -inline 0
<freehck>
*optimization
<ggole>
Does it do that even through module boundaries?
AlexRussia has quit [Ping timeout: 260 seconds]
<ggole>
OK, it does. Never mind.
FreeBirdLjj has joined #ocaml
<Drup>
freehck: from a cost point of view, applying a functor has a similar cost has applying a function. This code is not in a hot path, so from an optimization point of view, it's inconsequential, don't even bother :)
<freehck>
Ok. Good.
<Drup>
(that analysis, surprisingly, is valid for most optimization concerns: "It's inconsequential, don't even bother" :p)
pierpa has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
AlexRussia has joined #ocaml
ee_ks has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<freehck>
I found that I don't need generative functors to separate types with equal realization.
<freehck>
All I really need is to use type coercion.
<freehck>
Drup: But shortly: is this the thing that make Option.t comparable?
<ggole>
Yeah, pretty much
FreeBirdLjj has quit [Remote host closed the connection]
<freehck>
Got the thing! When I use "type xxx = ... with show" it will generate functions like pp_xxx and show_xxx.
<freehck>
And the same thing with sexp, compare and so on?
quicquid has left #ocaml [#ocaml]
jstolarek has quit [Ping timeout: 244 seconds]
al-damiri has joined #ocaml
zv has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<benmachine>
freehck: type blah = ... with sexp generates both blah_of_sexp and sexp_of_blah
<benmachine>
etc.
<benmachine>
but yeah, nowadays it's type blah = ... [@@deriving sexp]
loxs has quit [Quit: This computer has gone to sleep]
ygrek_ has joined #ocaml
Leonidas_ has joined #ocaml
Leonidas_ is now known as Leonidas
sepp2k has quit [Quit: Leaving.]
agarwal1975 has quit [Quit: agarwal1975]
fraggle-boate has quit [Quit: Quitte]
fraggle-boate has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
AlexDenisov has joined #ocaml
igt0 has quit [Quit: Connection closed for inactivity]
ygrek_ has quit [Ping timeout: 244 seconds]
octachron has quit [Quit: Page closed]
ygrek has joined #ocaml
Merv_ has quit [Remote host closed the connection]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
veggie_ has joined #ocaml
larhat has quit [Quit: Leaving.]
ee_ks has quit [Ping timeout: 255 seconds]
johnf has joined #ocaml
nojb has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 244 seconds]
srcerer has joined #ocaml
srcerer has quit [Client Quit]
srcerer has joined #ocaml
fraggle_ has quit [Ping timeout: 265 seconds]
pootler has joined #ocaml
NingaLeaf has joined #ocaml
FreeBirdLjj has joined #ocaml
ee_ks has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
jlouis has quit [Read error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number]
jlouis has joined #ocaml
Anarchos has joined #ocaml
ee_ks has quit [Ping timeout: 240 seconds]
pootler has quit [Read error: Connection reset by peer]
ohama has quit [Ping timeout: 265 seconds]
ohama has joined #ocaml
llamatarianism has joined #ocaml
monod has joined #ocaml
jstolarek has joined #ocaml
jstolarek has quit [Remote host closed the connection]
noze has joined #ocaml
<noze>
i need to compute some things with geodata that i got in json format (nothing very fancy, distances mostly)
<noze>
is there a lib for me?
Algebr` has joined #ocaml
fraggle_ has joined #ocaml
veggie_ has quit [Ping timeout: 265 seconds]
ee_ks has joined #ocaml
octachron has joined #ocaml
<Algebr`>
why would this happen Exception: Unix.Unix_error (Unix.EINTR, "read", "").
<Algebr`>
yes, there's a signal
<ggole>
That's normal for read
<ggole>
If it gets interrupted before any data is read, it can't return 0 or you'll think the file is empty
<Algebr`>
really? isn't it weird to say that something normal is to raise an exception?
<ggole>
The caml behaviour reflects the underlying system call in a pretty obvious way, is what I mean
<ggole>
(The system call sets errno rather than raising an exception, but that's a minor difference.)
jstolarek has joined #ocaml
<Algebr`>
I don't understand what I'm doing wrong, made some fds with pipe (), then used them for create_process and I'm write to a pipe and then trying to read
<ggole>
If you get EINTR you probably just need to try again
jstolarek has quit [Remote host closed the connection]
CuriousErnestBro has quit [Read error: Connection reset by peer]
CuriousErnestBro has joined #ocaml
<ggole>
I'm pretty sure you've got them backwards
<Algebr`>
I think so too
jstolarek has quit [Ping timeout: 260 seconds]
orbifx has quit [Ping timeout: 240 seconds]
annoymouse has joined #ocaml
<annoymouse>
I heard that Jane Street Core allows for operator overloading. Could someone point me to some docs/source code for this feature?
orbifx has joined #ocaml
<orbifx>
are there any articles covering the different build systems?
<orbifx>
i think I've seen one
<orbifx>
Want to pick one for logarion
loxs has joined #ocaml
AlexDenisov has joined #ocaml
<octachron>
annoymouse, function overloading is not possible (by design) in OCaml, you may have misinterpreted something else
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
veggie_ has joined #ocaml
noze has quit [Remote host closed the connection]
pootler has joined #ocaml
sh0t has quit [Ping timeout: 265 seconds]
blubberdiblub has joined #ocaml
<annoymouse>
octachron: I believe you can change the behavior of the eqauls operator depending on the types that it is called with using Core.
<annoymouse>
This is what my professor told me today.
<Drup>
either you misunderstood, or your prof is wrong. What you can do is have several = operators in different modules, that would apply to different types
<Drup>
that's quite different than overloading
<orbifx>
annoymouse: you can also override a function
<orbifx>
and maybe that is what Core does
<blubberdiblub>
hi, i just wanted to say thank you for OMake. it makes building my project so much easier
<rightfold>
did 4.03 get parallelism?
<orbifx>
anyone anything on build systems
<orbifx>
rightfold: not that I know of
<rightfold>
aww :(
loxs has quit [Quit: Leaving]
<orbifx>
do consider the alternative mechanisms
<annoymouse>
Drup: Let me give you some context. We were implementing signatures for an abstract datatype called set. We wrote a function called equals that takes in two sets and returns a bool. I wanted to know if we could overload the = operator to use our test for equality when comparing two sets. He said that there is going to be something similar to that in an
<annoymouse>
upcoming version of OCaml and that currently there is a way to pretty much do it using Core.
<octachron>
rightfold, 4.03 got flambda. Getting both multicore support and a new compiler middle end in the same release would probably have been overly ambitious
<rightfold>
ok :p
<octachron>
annoymouse, a important point to be aware is that there is a big difference between redefining a function/operator (always possible) and overloading it
pyon has quit [Quit: restart]
<annoymouse>
octachron: So is there a way to override/shadow the function such that it will use our custom definition of equality for sets if the operands are sets and otherwise use the default definition?
<octachron>
orbifx, for a simple project oasis/ocamlbuild are relatively fine
<orbifx>
what is the least noisy octachron ?
<orbifx>
polluting I mean
<orbifx>
I used one before, may have been oasis, and it was creating an extra folder. Was also doing my head in with a _tags file :P
pyon has joined #ocaml
sh0t has joined #ocaml
<octachron>
annoymouse, having the function selected by the type is not possible (and is also considered anti-modular)
veggie_ has quit [Ping timeout: 244 seconds]
<annoymouse>
octachron: So what do you think my professor was referring to then?
<octachron>
annoymouse, what your prof might have been talking about is modular implicit.
<octachron>
orbifx, ocamlbuid does create a _build directory and can require to edit the _tags file
<orbifx>
is oasis less intrusive and demanding? also what of OMake? is being sidelined?
<octachron>
orbifx, oasis provides a higher level description of package but uses itself either ocamlbuild or OMake to build package
<octachron>
the omake option is quite recent and I have not tested it myself
<orbifx>
so you use oasis over ocamlbuild?
<octachron>
annoymouse, modular implicit allows to select a function/operator depending on the implictely available module within the current context
<annoymouse>
that might be what he meant
<annoymouse>
I'll need to go to office hours to discuss it with him
<annoymouse>
thanks octachron
MercurialAlchemi has quit [Ping timeout: 248 seconds]
<octachron>
orbifx, for simple enough projects, quite often.
<orbifx>
Version 0.9.8.6 Release Candidate 1 (October 26, 2010)
<orbifx>
Version 0.9.9 Prerelease (June 20, 2007)
veggie_ has joined #ocaml
<octachron>
orbifx, honestly I don't really do complex project (more bizarre and barocco ones)
<orbifx>
finally what about ocamldoc?
<octachron>
for my limited needs, ocamlbuild with custom myocamlbuild.ml has been enough
<orbifx>
I just don't want to have to write all the rules manually in my makefile
<Drup>
orbifx: what about ocamldoc ?
<octachron>
orbifx, the right question may be: are you expecting to have a (very) complex build process right from the start?
<veggie_>
what is the backtick in [`a; `b; `c]
<octachron>
veggie_, `a, `b … are polymorphic variants
<orbifx>
octachron: no
<orbifx>
Drup: something which handles ocamldoc builds too
<octachron>
(they should start with a capital, but a historical mistake has left this syntax valid )
<octachron>
orbifx, then start simple with the build system too
<veggie_>
octachron: even if it's not being used in a type declaration? (just a list literal)
<octachron>
yep: [`a;`b;`c] has type [> `a | `b | `c ] list
<veggie_>
interesting, thanks
<orbifx>
octachron: I have, but writing makefile rules is a bit tedious
<orbifx>
but I think I might just go on with that way
<Drup>
orbifx: everything decents handle ocamldoc, so that includes oasis and vanilla ocamlbuild
pyon has quit [Quit: Reality is multi-dimensional. More precisely, two-dimensional.]
<Drup>
(also, "something simple" ≠ "writing your own makefile rules")
<veggie_>
by the way, are there any recommended ways of learning ocaml? the tutorial articles on the ocaml website are kinda.. not so great
<Drup>
veggie_: on monday the OCaml MOOC is starting !
<veggie_>
is it free?
<Drup>
Yep, link in the motd
<veggie_>
awesome thanks
<Drup>
(there are 2500 people registered now, it's gonna be great)
pyon has joined #ocaml
<octachron>
orbifx, I agree with Drup that writing your own makefile rules does not really qualify as simple for OCaml
rpip has joined #ocaml
<orbifx>
Drup: writing Makefiles is simple for me because of my experience
<orbifx>
but yes it's tedious
shinnya has joined #ocaml
_andre has quit [Quit: leaving]
jstolarek has joined #ocaml
<Drup>
it's not a question of tediousness, it's that given ocaml's compilation scheme, it's extremly likely to be wrong
jstolarek has quit [Remote host closed the connection]
<Drup>
I'm just saying you're bad at makefile, I'm saying that a lot of people have rolled their own makefiles before, and they were all more or less broken in one way or another. OCamlMakefile seems to be the only one non broken, and it's ... a bit complex, let's say
kamog` is now known as kamog
ggole has quit []
struk|work has quit [Quit: Page closed]
Algebr` has quit [Ping timeout: 255 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Denommus has joined #ocaml
NingaLeaf_ has joined #ocaml
Denommus` has joined #ocaml
NingaLeaf has quit [Ping timeout: 276 seconds]
<orbifx>
Drup: OCamlMakefile is "non-broken" as a build system in general, or tends to make less broken implementations?
<orbifx>
brb
orbifx has quit [Quit: WeeChat 1.5]
orbifx-m has joined #ocaml
veggie_ has quit [Ping timeout: 240 seconds]
Denommus has quit [Ping timeout: 265 seconds]
<regnat>
orbifx-m: OCamlMakefile is a Makefile template for ocaml, not a build system itself
<orbifx-m>
Back
<regnat>
(OCamlMakefile ≠ OMake)
veggie_ has joined #ocaml
NingaLeaf has joined #ocaml
<orbifx-m>
Thanks regnat
NingaLeaf_ has quit [Ping timeout: 264 seconds]
<orbifx-m>
And Drup and octachron
orbifx has joined #ocaml
monod has quit [Quit: Sto andando via]
orbifx has quit [Ping timeout: 244 seconds]
johnf has quit [Remote host closed the connection]
blubberdiblub has quit [Quit: Leaving]
pierpa` has joined #ocaml
pierpa has quit [Ping timeout: 276 seconds]
rgrinberg has joined #ocaml
NingaLeaf has quit [Quit: Leaving]
maurer has joined #ocaml
FreeBirdLjj has joined #ocaml
<maurer>
Does anyone know if there's a way to ask opam not to run tests?
<maurer>
(I want to opam install something that is going to fail some tests due to the tests being fragile to a dependency version, but it does what I'd like)
<rgrinberg>
maurer: i don't think that opam runs tests by default unless you tell it to
<maurer>
Hm, when I do an opam pin add, it's definitely running tests and failing. I'll check if the project just turned them on as part of the build
FreeBirdLjj has quit [Ping timeout: 272 seconds]
<struk|desk>
has anyone switched their projects from core to base yet? if so, pleasant experience?
<maurer>
Ah, make test is part of the install action
<rgrinberg>
maurer: yeah that is wrong. make test should be part of build-test:
Algebr` has joined #ocaml
Algebr` has quit [Ping timeout: 260 seconds]
sh0t has quit [Ping timeout: 255 seconds]
<llamatarianism>
hullo
<llamatarianism>
does anyone know if (and how) it's possible to get autocompletion in utop inside emacs?
<llamatarianism>
like, in an actual terminal, I can do M-tab and it'll autocomplete stuff
sh0t has joined #ocaml
pierpa` is now known as pierpa
<Bluddy[m]>
struk|desk: base doesn't seem to be in opam yet