nikki93 has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 255 seconds]
travisbrady has joined #ocaml
WraithM has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
tautologico has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
travisbrady has quit [Quit: travisbrady]
shinnya has joined #ocaml
travisbrady has joined #ocaml
ousado has quit [Ping timeout: 240 seconds]
ousado has joined #ocaml
<tautologico>
can I have specific configuration switches for opam packages? e.g. opam install pkg --with-tests and this would change dependencies (with tests requires ounit, without tests it's not required, etc)
<Drup>
I'm not sure about tests
<Drup>
but you can variables in your build script that depends on the available packages
<Drup>
can have*
q66 has quit [Ping timeout: 252 seconds]
<tautologico>
not necessarily tests
<tautologico>
I'd like to do opam install mypkg --with-X
<tautologico>
and then the package would have a dependency on X, otherwise it wouldn't... but testing is another good case, a package user it not necessarily interested in tests
<tautologico>
and this switch would have to be defined by the package, of course
<Drup>
you can't add a command line option
<Drup>
but you can specify in your package that you have an optionnal dependency on X, and you may access a variable describing if X is installed or not
<tautologico>
it would be better if the user could override this with a cmd line switch, such that if the dependency is missing it is then installed by the system
<tautologico>
but this will do
<Drup>
well
<Drup>
just do "opam install X mypkg" in this case :)
<tautologico>
yes, but it may not be obvious to the user that mypkg can depend on X
<Drup>
"opam show mypkg" will answer that
<tautologico>
opam info doesn't say
<tautologico>
yes, kinda
<tautologico>
it says "depends" but not "optionally depends on"
<Drup>
it does, there is a "depopts" line
<tautologico>
yes, in the opam file, but not in the output of the tool
<tautologico>
anyway, that's a minor thing
<Drup>
in the output too
<tautologico>
I see only "depends" here
<tautologico>
package: cairo
<Drup>
it's only there if there are depopts
<tautologico>
depends: ocamlfind & lablgtk
<Drup>
yes, try "cairo2"
<tautologico>
oh I see
<Drup>
(the .opam I shown was for cairo2)
<tautologico>
true
<tautologico>
so yeah, that's ok
<Drup>
also
<Drup>
if X depends optionnaly on Y
<Drup>
and X is installed but not Y, then latter Y is installed, then X will be recompiled
<tautologico>
very good
<Drup>
or very terrible, when it recompiles coq when you install lablgtk in order to compile coqide :D
<tautologico>
indeed :)
shinnya has quit [Ping timeout: 255 seconds]
travisbrady has quit [Quit: travisbrady]
ollehar has joined #ocaml
zpe has joined #ocaml
<Drup>
tautologico: if you are using oasis as build system, there is a very nice tool called oasis2opam
<tautologico>
I'm not using it right now, what's the advantages of using oasis instead of creating a package directly with opam?
<Drup>
oasis is a nice tool all around, not only when you want to create your opam package
zpe has quit [Ping timeout: 252 seconds]
<tautologico>
I know it can help with builds and so on
<Drup>
it will generate a portable build system and will handle a good amount of boring stuff, like configuring, instalation and so on
yacks has quit [Read error: Operation timed out]
BiDOrD has quit [Read error: Connection reset by peer]
ollehar has quit [Ping timeout: 240 seconds]
travisbrady has joined #ocaml
travisbrady has quit [Quit: travisbrady]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
tidren has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
clan has joined #ocaml
nikki93 has joined #ocaml
ggole has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 268 seconds]
tidren has quit [Remote host closed the connection]
maattdd_ has joined #ocaml
tidren has joined #ocaml
tidren has quit [Remote host closed the connection]
<ruzu>
o caml, my caml! <3
maattdd_ has quit [Ping timeout: 240 seconds]
axiles has joined #ocaml
tautologico has quit [Quit: Connection closed for inactivity]
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
Kakadu has joined #ocaml
tidren has joined #ocaml
zzing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
elfring has joined #ocaml
willy_ has joined #ocaml
<willy_>
bonjour
zpe has joined #ocaml
zpe has quit [Ping timeout: 268 seconds]
ygrek has joined #ocaml
ggherdov_ has quit [Changing host]
ggherdov_ has joined #ocaml
ggherdov_ has quit [Changing host]
ggherdov_ has joined #ocaml
<adrien>
% git rm otherlibs/bigarray/Makefile.nt
<adrien>
:)
maattdd_ has joined #ocaml
zpe has joined #ocaml
maattdd_ has quit [Ping timeout: 268 seconds]
zpe has quit [Ping timeout: 255 seconds]
Simn has joined #ocaml
zpe has joined #ocaml
Hannibal_Smith has joined #ocaml
neo007 has joined #ocaml
<neo007>
Hi,hackers!
maattdd_ has joined #ocaml
<neo007>
Recently I have a peek into the Real World OCaml, and find a strange thing in ocaml. That is , when ocaml get compiled, the code transform to lisp ,but the book do not like to say so, it just say that is the list s-exp.
<companion_cube>
o/ neo007
<companion_cube>
neo007: the book uses the Core library, which uses a lot of S-expressions for printing things
<companion_cube>
but ocaml itself isn't related to lisp
<neo007>
so I suspect ,if the versatile of ocaml is actrually the ability of lisp.
<neo007>
No, ocaml 's compiler do use lisp too.
<companion_cube>
certainly not :)
<companion_cube>
(well there might be a s-expression-like intermediate format somewhere, but it's not lisp)
<neo007>
then why do the book draw that graph?
<companion_cube>
isn't it a historical description?
<companion_cube>
(do you have a link?)
<companion_cube>
20 years ago, or something like this, the first Caml interpreter was in lisp
<neo007>
yes,that is right. this is what I can not understand. whatever it called list or s-exp, it is some format of lisp, it is a middle language in the compile step.
<companion_cube>
s-expressions are a simple serialization (text) format, which looks like lisp
<companion_cube>
ie, it's (parenthesis (to delimit) the (structure))
<neo007>
I can draw that graph here: text->abstract grammer tree -> type tree-> lambda-> bytecode or native code.
<companion_cube>
ah, this
<companion_cube>
yes, some of those formats are printed as s-expressions
<companion_cube>
because it's very simple to print and parse
<companion_cube>
it doesn't mean they have a lisp-like semantics
<neo007>
yes, sometimes it is just a serialization. but when in the compiler it is actually a lisp but it is named a lambda.
<companion_cube>
it's the serialized form of the AST (the program that is compiled)
<companion_cube>
therefore, yes, it represents code, with anonymous functions; etc.
<neo007>
yes. it is actually a lisp for compiler. it is just hidden under the ocaml grammer
<companion_cube>
if you call "lisp" every piece of S-expression that contains code, then yes :)
<neo007>
haha
<neo007>
but is the s-expression come first or the lisp come first?
<neo007>
or they occured the same time?
<adrien>
in the 70s? we're not old enough to tell
<adrien>
but afaiu, sexps were first a way to store intermediate compiler data
<adrien>
and then people found out it was a nice enough way to code too
<adrien>
which wouuld mean sexps first
<nicoo>
neo007: Well, I could claim that all algebraic datatypes are S-expressions, once types get erased
<neo007>
according to my knowledge about the history of lisp. it is in 60's, when lisp emerged with list processing.
<adrien>
60s and 70s are the same: hippies with long hair and LSD
<neo007>
yes, you are right. may be lisp is nothing but a feature of list or s-exp
<neo007>
when compare the OCaml's compiler to the Chez scheme's, which will win?
<companion_cube>
I think lisp was among the first uses of S-expressions (although initially it was to also contain "M-expressions")
<companion_cube>
but then people also used the format for other purposes
pminten has joined #ocaml
<neo007>
yes,it make sense.
<neo007>
ocaml, common lisp, chez scheme, are all succeed based on the compiler.but which is the best of this three?
<companion_cube>
they are quite different languages
<companion_cube>
ocaml isn't a lisp at all
<neo007>
yes, but they all deal with the s-exp and compiler.
<companion_cube>
that's totally irrelevant
<companion_cube>
what matters is the language itself, not its intermediate forms
<companion_cube>
because hopefully that's what you read/write
<adrien>
hmm
<adrien>
otherlibs/{num,str}/Makefile.nt do the following:
<adrien>
sed -e 's/\.o/.$(O)/g' .depend > .depend.nt
<adrien>
the first one is what the non-nt variant do
<adrien>
does*
<adrien>
actually actually that would be because the msvc port uses ".obj" as an extension instead of ".o"
<adrien>
but that is not done for everything in otherlibs/
<ggole>
neo007: ocaml's internal lambda form isn't s-expressions, it's a variant
<ggole>
s-expressions are just used to print it
<neo007>
well, but it still have some relation with the s-exp.
<ggole>
I think the relation is that the universe of Lisp data structures forms a variant
<ggole>
But its a different one to the internals of the compiler.
<companion_cube>
neo007: you could use S-expressions to print intermediate representations in a C compiler
<companion_cube>
that wouldn't make C a lisp variant
<ggole>
And you can, of course, encode sums into lists + symbols + atoms easily enough
<neo007>
oh, it seems so.
<adrien>
hmm, I think bigarray can avoid the .depend file because the only dependencies are "%.o: %.c" and no other .c file
<adrien>
but that means that the msvc port probably doesn't rebuild the .obj files when .h files change
<ggole>
So if you have type term = Int of int | Add of term * term, you could encode that as a s-exp that is either (int <n>) or (add <l> <r>). And if you printed the s-exp, it would look a lot like -dlambda.
<ggole>
That doesn't make term an s-expression.
ollehar has joined #ocaml
<neo007>
yes. it is.
<companion_cube>
everything is an S-expression then...
<companion_cube>
so everything's a lisp, even cobol
<neo007>
well, if follow the view.
<neo007>
:)
<neo007>
Thank you hackers! for telling me so much. I have something to deal, so see you. may you have a good day!
neo007 has quit [Ping timeout: 245 seconds]
tobiasBora has joined #ocaml
<tobiasBora>
Hello !
<tobiasBora>
I would like to get a web page from an API (in json) but I don't know what is the best way to download it with Ocaml (And I think that doing Sys.command "wget..." is ugly because it is OS dependent)
<adrien>
ocamlnet has code to do it fairly easily
<adrien>
cohttp might suit you too but I've never tried it
<tobiasBora>
Thank you. Is it this module (Nethttp) I'm suppose to use ?
<gasche>
adrien: physical access is generally on tuesday
<gasche>
which revision were you talking about? git log trunk can't find 14402
<adrien>
it's in the 4.01 branch
<gasche>
ok
<adrien>
from roughly one month ago
<adrien>
I'll probably have time to check mantis and the windows spec by tuesday (I hope)
<gasche>
I'd be glad to commit good stuff if you have some
<gasche>
on an unrelated note, I'm actively conflicting with you right now, implementing DESTDIR support
<gasche>
(it's done, I just have to test it and I'll probably send a PR)
<tobiasBora>
adrien: Great thank you
<adrien>
heh
<adrien>
Makefile.nt is so far very simple
<gasche>
if per chance you knew about that stuff, could you tell me whether it's a problem to have $(DESTDIR) all over the place when DESTDIR is not set?
<adrien>
partly because of some of the changes that went in for cross-compilation
<adrien>
no it's not an issue at all
<gasche>
(I mean, should I implement some sort of "default to ''" logic or is crappy unfound variable defaults an idiom in shell programming?)
<adrien>
DESTDIR is to be used as: cp foo $(DESTDIR)$(PREFIX)
<gasche>
I got that part
<gasche>
hm
<adrien>
that way, when DESTDIR is not set, you get back to PREFIX and everything works as expected
<gasche>
I uese $(DESTDIR)/$(PREFIX), is that a problem?
<adrien>
:)
<adrien>
it is
<gasche>
ok
<gasche>
found that form on some BSD manual, I guess they don't care about Windows
<adrien>
I need to check to be 100% sure but iirc it should be without /
<gasche>
but my prediction would be that terminal marginally enhanced to display pictures using ugly hacks (escape codes etc.), like terminology, will not get much traction in the future
<gasche>
that people will only jump towards tool that provide radical change
<adrien>
gasche: I don't think that was terminology's goal
<gasche>
TermKit was such a tool, but apparently hard to design/maintain
q66 has quit [Ping timeout: 252 seconds]
<adrien>
that's one feature but not the whole thing
<gasche>
I think that IPython and related notebooks have a chance to become such a tool
<adrien>
terminology should be very fast
<gasche>
they have the opportunity to bring much more than just "images" to what terminals are
<adrien>
iirc termkits had its dead corpses in closets and ugly things
<gasche>
of course
<gasche>
it was a hack
<gasche>
on the other hand
<gasche>
notebooks naturally run on web interfaces
<gasche>
and that's a big plus
Anarchos has joined #ocaml
<gasche>
I don't want only images / films
<gasche>
I want animations, etc.
q66 has joined #ocaml
<pippijn>
animations?
<ggole>
Terminal + pics isn't all that interesting imho
<ggole>
I'd like a cross between a terminal and a spreadsheet though
<ggole>
With graphing tools and a bunch of functionality built in
<gasche>
I think we agree
<gasche>
and I don't believe much in incremental evolution of today's terminal
<gasche>
I think notebook are more likely to be adopted for this purpose
<ggole>
No, it's mired in history.
<gasche>
because they have less graybeards with strong opinions on how it should behave
<Anarchos>
gasche ;)
travisbrady has joined #ocaml
<ggole>
I wonder how you'd do tabular data in a non-language specific way, though
<gasche>
if you like spreadsheets
<gasche>
you should have a look at the recent paper by Sean McDirmid and Jonathan Edwards
<adrien>
systhreads/Makefile{,.nt} are awful; they're completely different
shinnya has joined #ocaml
<ggole>
It's not so much that I like spreadsheets as it is that I hate the command line :)
<nicoo>
adrien, pippijn : Which video were you mentionning, in relation with EFLs ?
<adrien>
nyancat?
<ggole>
Spending mental effort on how to extract the second field of some stream of text is just so daft
<adrien>
awk!
<pippijn>
yes, awk
<pippijn>
I think that is not the main problem
<pippijn>
the main problem is that it's text
<ggole>
Text in an inevitably poorly specified format
<pippijn>
"ls" just outputs text
flixr has left #ocaml []
<pippijn>
processing the output of "ls" is generally unsafe
<pippijn>
in powershell, "ls" outputs a data structure
<adrien>
use find :P
<adrien>
but yeah
<adrien>
the issue is that windows has APIs for everything
<adrien>
but it has way too many of them
<pippijn>
that when not piped into some other tool, is stringified in a way that "ls" is expected to be output
<pippijn>
I don't care about windows
<pippijn>
but powershell is nice
<adrien>
you should
<pippijn>
yes, I should
<pippijn>
eventually I will
<pippijn>
but at the moment I don't
<adrien>
you misunderstand
<adrien>
unix is "everything is a file" and process chaining
<adrien>
windows is APIs
<adrien>
if you want to avoid strings and pipes and so on, you should take a look at what others do
<pippijn>
ah
<pippijn>
right
<pippijn>
true, powershell works the way it does because it unifies all those apis
<adrien>
gasche: for the "clean" rules in Makefile, I'm tempted to replace "rm -f *.(O)" with "rm -f *.o *.obj"; do you see any objection to that?
<adrien>
gasche: basically, it means it will always work even when variables haven't been bound yet and it makes it easier to understand (right now I'm unable to tell you which of $(SO) or $(DO) or $(EXT_DLL) I would have to use)
<adrien>
pippijn: it also means the tools have to be built into the shell and not third-party
<pippijn>
no
<pippijn>
though in powershell I guess it is
<adrien>
if you don't want to parse strings you need tools to return data through an API
<adrien>
or at least serialize
<pippijn>
if, instead of outputting a list of files, "ls" would output a serialised data structure containing all its data
q66 has quit [Ping timeout: 252 seconds]
<pippijn>
you could filter and select from that table and then output it
<ggole>
You could do half-structured things like having one fd for each column
<ggole>
And then a metadata fd to indicate how many columns, data formats of each, names, etc
<adrien>
pippijn: then you need _all_ tools to do that
<pippijn>
no
<pippijn>
strings by default
<ggole>
That'd be structured in a more or less language-independent way
<ggole>
And it would actually run on Unix machines today, too
<adrien>
and how do you tell the two output apart?
<pippijn>
possibly by magic
<adrien>
:)
<ggole>
...are you asking me, or pippijn?
<pippijn>
imagine ls being an ocaml program
<pippijn>
and it outputs a serialised data structure
<gasche>
I think adding more structure has already been done
<ggole>
In the limit case you reinvent a Lisp machine
<ggole>
And "process output" is an arbitrary full-blown, GCed data structure
<ggole>
That did not go over well last time.
<pippijn>
hmm
<pippijn>
why not?
<ggole>
All the hardware and software was too specific
<ggole>
So it all died when another approach ended up delivering faster
<pippijn>
you could output a binary json kind of format
<ggole>
That's what TermKit did, iirc
<ggole>
Well, probably just textual json
<ggole>
Standard self-structured formats would be nice though
<ggole>
You could imagine specifying variants, lists, arrays, etc
<gasche>
I remember a reimplementation of some Unix tools with more robust handling of delimiters
<gasche>
can't find it again, though
<ggole>
Doing things in band is inherently problematic
<ggole>
Because you can't encapsulate nicely
<pippijn>
gasche: some tools use \0 as delimiter
<pippijn>
find+xargs
<ggole>
You soon end up wanting to delimit something containing your delimiter
<pippijn>
yes
<ggole>
And Unix just punts on that entirely :/
<ggole>
The \0 thing is particularly sad
<ggole>
Since basically every tool has its own strange way of saying "use \0"
<ggole>
Or doesn't support that.
<adrien>
well, I got a bit stuck on systhreads/Makefile.nt
q66 has joined #ocaml
<adrien>
and why isn't code review directly in version control systems?
<adrien>
I'm making changes which are too small to deserve dedicated commits but I'd like a way to store an explanation as to why I make them
<pippijn>
yeah
<adrien>
and that should be visible when doing both code review and when checking the history
<pippijn>
I do that in github :\
<pippijn>
line comments on my own commits
<pippijn>
I'd like that integrated in git
<adrien>
and I cannot add comments because I'm making changes to a file I'm removing
darkf has quit [Quit: Leaving]
<Anarchos>
adrien comment a void commit on the folder with a comment in the commit comment ?
<adrien>
two many times words several time
<adrien>
s
* adrien
stack overflows
<Anarchos>
adrien sorry :)
<pippijn>
also, I still want full code auditing software
<gasche>
adrien: just make small commits?
<gasche>
I don't see the problem with that
<gasche>
we can always squash together later if someone complains
<adrien>
what made me complain was this stuff in Makefile.nt:
<adrien>
OBJS=a1 a2 a3 baz a4 a5
<adrien>
foo: bar baz
<adrien>
bar: $(OBJS)
<adrien>
and in Makefile, "foo: bar"
struktured has quit [Read error: Operation timed out]
<adrien>
and I'd probably have to do a few "small commits" per file I'm changing and so far: 24 files changed, 281 insertions(+), 587 deletions(-)
<pippijn>
how do you get these statistics?
<gasche>
git diff --stats?
<pippijn>
ah
<gasche>
--shortstat in this case
<pippijn>
okay
<gasche>
(and it's --stat, not --stats)
<gasche>
adrien: again, I don't see the problem with having many small commits
<adrien>
I don't think I'd like to see such commits in the logs if I had to check the history
<adrien>
they make no sense on their own
<mrvn>
put them into a branch and then merge the branch as a whole.
<mrvn>
That way bisect will also skip all the little patches unless the error is in them.
<gasche>
mrvn: remember that the final VCS will be SVN, which may or may not handle that well
<gasche>
but in any case, for review, small git patches are fine
<gasche>
again again, we can always squash them later
<mrvn>
well, svn sucks for that.
<mrvn>
squash them
<rom1504>
why would you use svn ?
<gasche>
historical reasons
bjorkintosh has quit [Quit: Leaving]
<mrvn>
you can migrate to git
<Anarchos>
where can i find an example of mutually recursive modules ?
<mrvn>
module rec M : sig end = struct end and N : sig end = struct end;;
<Anarchos>
gasche i know what they are and i read the doc, but i want samples of code more stuffed
elfring has quit [Quit: Konversation terminated!]
<gasche>
what do you need?
<Anarchos>
gasche i am writing a software similar to agda . I wonder if recursive modules are the good solution to the evaluate/typing mutually defined functions.
bjorkintosh has joined #ocaml
<mrvn>
why not just use "let rec"?
<Anarchos>
mrvn i want to separate them in two files for clarity, and not having this file too long (in coq they decided to separate them, and couldn't use recursive modules)
<mrvn>
you can't have recursive modules in 2 files
<gasche>
but you could define functors and then tie the knot
<Anarchos>
gasche but i think they decided not to use this solution in coq, right ?
<gasche>
just as you could define "let eval typecheck = ...", "let typecheck eval = ...", and then tie the knot
<mrvn>
or pass a closure of the first function to the second instead of having a recusion.
<gasche>
this
<mrvn>
or pass the first module as argument to the second
<gasche>
recursive modules make sense when you also need to export private types along the way
<gasche>
if you only have values, value recursion is simpler
<gasche>
Anarchos: I'm not familiar with Coq's implementation
<Anarchos>
gasche there is an article of JC Filliatre (design of a proof assistant : coq version 7)
ia0 has quit [Quit: leaving]
ia0 has joined #ocaml
<ggole>
Aargh, I do so wish that modules could mutually refer across files :(
<ggole>
Aargh, I do so wish that modules could mutually refer across files :(
<ggole>
Oops
<ggole>
That was meant to be "Makes it artificially difficult to split things up when they happen to recurse"
<adrien>
oh a gun
<adrien>
which shoots both ways
<adrien>
(afk)
<mrvn>
you can hack it by disabling cross module inlining.
pminten has quit [Quit: Leaving]
Simn has quit [Ping timeout: 246 seconds]
<ggole>
"Artificially difficult" indeed. :)
<mrvn>
If they are that closely dependent that they recurse then how is splitting them into 2 files going to make it easier to understand?
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
<ggole>
The same way that splitting anything into two independent parts makes it easier to understand?
<ggole>
Do you put all your source code in one file because it is all one project?
ygrek has joined #ocaml
<mrvn>
I split them into independent units.
<Drup>
ggole: if they contain mutually recursive modules, I'm not sure where the "independent" come from ...
<ggole>
Mutually recurring modules are independent in exactly the same way that mutually recurring functions and data structures are independent
<ggole>
They refer to each other as wholes without needing to know about the bits
<ggole>
That's a perfectly natural thing to want :/
<mrvn>
but they are mutually dependend on each other
kakadu_ has joined #ocaml
<ggole>
That's why they should mutually recur naturally instead of using some silly hack
Kakadu has quit [Ping timeout: 268 seconds]
<pyon>
Structural subtyping for objects is in a sense "dual" to coercing variants to larger ones, right?
<Drup>
yes
<Drup>
ggole: you can't have cycle in the module dependency graph anyway
<Drup>
(I'm not exactly sure where this restriction come from, though)
<pyon>
Is there a reason why OCaml has both records and objects? Don't these features overlap?
<Drup>
pyon: object also have other uses, like open recursion
<mrvn>
Error: This expression has type Ras.points = Ras.MAKE(M).points but an expression was expected of type ('a, 'b, 'c) Bigarray.Array1.t
<mrvn>
But I have type points = private (int, Bigarray.int16_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
<mrvn>
What do I have to specify for the functor so the points type keeps its private infos?
<Drup>
(I should wikify this at some point, because I keep linking it)
<ousado>
pippijn: how do I build cparser?
<ggole>
Drup: to make it work I imagine that you'd need to require that mutually recurring modules be presented to the compiler at the same time, and fix build tools to know about it
<ggole>
But I don't think there's any conceptual problem there, just a SMOP
<pyon>
Drup: Normally I want structural subtyping but not classes and inheritance... For that, I still end up having to use objects anyway.
Simn has joined #ocaml
<ousado>
pippijn: you mention obuild there, so I installed it via opam, but it doesn't find an obuild file
<Drup>
pyon: sure, that's normal
<Drup>
pyon: that's the main use of objects, structural subtyping :p
<Drup>
mrvn: didn't you just forget to project along the second component ?
<mrvn>
meaning what?
<Drup>
that I don't know how to read, nevermind
<Drup>
It should be exported correctly
yacks has joined #ocaml
<Drup>
mrvn: oh, of course, silly me
yacks has quit [Read error: Connection reset by peer]
<Drup>
you need to explicitly coerce
shinnya has quit [Ping timeout: 240 seconds]
<mrvn>
Drup: where?
<Drup>
when you want to transform a point into a Bigarray.Array1.t
<mrvn>
let res = Ras.points_create () in
<mrvn>
let r = (res : ('a, 'b, 'c) Bigarray.Array1.t)
<mrvn>
Error: This expression has type Ras.points = Ras.MAKE(M).points but an expression was expected of type ('a, 'b, 'c) Bigarray.Array1.t
<mrvn>
Drup: problem is I have blocks and points and both need .{}
<Drup>
yep
<mrvn>
block, blocks and points actually
<gasche>
Drup: I need context about your question, didn't follow the discussion
<gasche>
where's the code being discussed?
<Drup>
gasche: if I have "type t = private int" and a value of type t, I can coerce to int
<Drup>
but the coercion is explicit
<Drup>
the question was : why does it has to be explicit ?
<gasche>
for principality
<gasche>
(of type inference)
<Drup>
ok
<Drup>
that's what I though
<mrvn>
"A principality (or princedom) can either be a monarchical feudatory or a sovereign state, ruled or reigned over by a monarch with the title of prince or by a monarch with another title within the generic use of the term prince." I think that is the wrong page
<mrvn>
gasche: why can't private int not be unified with int?
<gasche>
they're distinct types, that's the point
<mrvn>
so is [> `Foo] and [> `Foo | `Bar]
<gasche>
those are polymorphic type schemes that have common instances
travisbrady has quit [Quit: travisbrady]
<mrvn>
Isn't the point of private to only block the creation of the type but allow all other operations?
<gasche>
type t = private int creates a fresh type t with a subtyping relation (t <= int)
<mrvn>
I know
<gasche>
if you could unify t and int, you could create t's by providing int's
<mrvn>
it should only go one way
<gasche>
unification is bidirectional
<Drup>
There would be no problem with typeclasses ! (wink wink companion_cube)
<Drup>
(sorry, that was random)
<mrvn>
gasche: so any idea how to ensure Bigarrays are only created with a certain size without making access to the elements a pain?
<gasche>
you could overload the Bigarray module
<Drup>
that was my proposition
<mrvn>
gasche: I have points and block types that both are bigarrays.
<gasche>
Alain has a branch where coercions are implicitly inserted whenever that helps the type-checker accept the program -- or at least sometimes
<gasche>
you could provide "get" and "set" functions and ask users to use them
<gasche>
I agree overloadable syntactic sugar would be nice
<Drup>
gasche: the syntactic sugar for array access is overloadable
<Drup>
well, overwritable, at least
<Drup>
mrvn: In your place, I would provide some one letter module P and B with overwritten BigArray module
<gasche>
I'd like to be able to use get/set notation for Hashtable as well for example
<gasche>
also (::) for Map and Set
<Drup>
gasche: how would the typing work in ocaml ?
<mrvn>
Maybe I will provide an operator.
<mrvn>
But how do I get it to allow both get and set functionality?
elfring has joined #ocaml
<mrvn>
would be nice if one could do: let (.{}) = (Array.get, Array.set)
travisbrady has joined #ocaml
manizzle has joined #ocaml
manizzle has quit [Remote host closed the connection]
struktured has quit [Read error: Operation timed out]
rand000 has quit [Ping timeout: 252 seconds]
jbrown has joined #ocaml
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
jbrown has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
pawelbx has quit [Ping timeout: 240 seconds]
claudiuc_ has quit [Read error: Connection reset by peer]
claudiuc has joined #ocaml
clan has quit [Quit: clan]
ollehar has joined #ocaml
tobiasBora has quit [Ping timeout: 268 seconds]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
clan has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
<mrvn>
should a libraries .cmo file be in the lib or the -dev package in Debian?
tobiasBora has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
tobiasBora has quit [Client Quit]
<pippijn>
gasche: oh :)
<pippijn>
ousado: you need my obuild
<pippijn>
ousado: I didn't know there was something called obuild when I made my obuild
<pippijn>
ousado: after etaps, I'll make opam packages
<adrien>
mrvn: cmo? what is that useful for?
<mrvn>
adrien: bytecode
<adrien>
I meant, compared to cma
ygrek has joined #ocaml
travisbrady has quit [Quit: travisbrady]
<mrvn>
adrien: no idea
<adrien>
are you going to dynlink it?
<adrien>
but actually, I think I've never understood how debian split ocaml packages
<mrvn>
I have no idea what users might or might not do
<mrvn>
looks like lintian complains (about the -dev) when I put the cmo in the lib package.
rand000 has joined #ocaml
imortalk has quit [Ping timeout: 252 seconds]
ygrek has quit [Ping timeout: 240 seconds]
imortalk has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
struktured has joined #ocaml
Thooms has joined #ocaml
ggole has quit [Ping timeout: 255 seconds]
termos has joined #ocaml
rand000 has quit [Quit: leaving]
travisbrady has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
acieroid has joined #ocaml
michel_mno_afk has joined #ocaml
clan_ has joined #ocaml
travisbrady has quit [Quit: travisbrady]
talzeus has joined #ocaml
julm_ has joined #ocaml
siddhart1v_away has joined #ocaml
maurer_ has joined #ocaml
Valda has joined #ocaml
amiller_ has joined #ocaml
asmanur_ has joined #ocaml
clan_ has quit [Read error: Connection reset by peer]
alex_nx_ has joined #ocaml
struktured has quit [*.net *.split]
asmanur has quit [*.net *.split]
Valdo has quit [*.net *.split]
thorsten` has quit [*.net *.split]
acieroid` has quit [*.net *.split]
maurer has quit [*.net *.split]
cthuluh has quit [*.net *.split]
julm has quit [*.net *.split]
alex_nx has quit [*.net *.split]
amiller has quit [*.net *.split]
Valda is now known as Valdo
clan has quit [*.net *.split]
bjorkintosh has quit [*.net *.split]
Submarine has quit [*.net *.split]
michel_mno has quit [*.net *.split]
talzeus_ has quit [*.net *.split]
pyon has quit [*.net *.split]
siddharthv_away has quit [*.net *.split]
michel_mno_afk is now known as michel_mno
cthuluh has joined #ocaml
axiles has quit [Remote host closed the connection]
Averell has quit [Read error: Connection reset by peer]
<bernardofpc>
should I build two functions for Format.fprintf and Printf.fprintf, or define one in terms of the other (and in this case, is there any recommendation as to which is the base one, and which is just a "wrapper" ?)
nikki93 has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
averell has joined #ocaml
willy_ has quit [Quit: This computer has gone to sleep]
averell is now known as Averell
nikki93 has joined #ocaml
watermind has joined #ocaml
<watermind>
I just noticed Batteries has list comprehensions
<watermind>
is anything of the sort also available in core?
travisbrady has joined #ocaml
Thooms has quit [Read error: Operation timed out]
ollehar has joined #ocaml
travisbrady has quit [Quit: travisbrady]
jbrown has quit [Remote host closed the connection]
maattdd_ has quit [Ping timeout: 252 seconds]
shinnya has joined #ocaml
darkf has joined #ocaml
nikki93 has quit [Remote host closed the connection]
travisbrady has joined #ocaml
nikki93 has joined #ocaml
travisbrady has quit [Quit: travisbrady]
lostcuaz has joined #ocaml
amiller_ is now known as amiller
amiller has quit [Changing host]
amiller has joined #ocaml
madroach has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
interstatus has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
NoNNaN has quit [Remote host closed the connection]