infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
philipwhite has quit [Ping timeout: 260 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 240 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
kalio has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
ryanartecona has quit [Quit: ryanartecona]
spew has joined #ocaml
spew has quit [Quit: foobar]
spew has joined #ocaml
ryanartecona has joined #ocaml
seangrove has quit [Ping timeout: 240 seconds]
spew has quit [Quit: foobar]
demonimin has quit [Ping timeout: 240 seconds]
ziyourenxiang has joined #ocaml
keep_learning has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
IRC-Source_31789 has joined #ocaml
IRC-Source_31789 has quit [Client Quit]
pierpa has quit [Quit: Page closed]
mfp has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 240 seconds]
nullifidian_ is now known as nullifidian
johnelse has quit [Read error: No route to host]
johnelse has joined #ocaml
diphuser has joined #ocaml
<rgrinberg>
RWO explains variance pretty well i think in the OO chapters
<rgrinberg>
my memory could be tricking me though
sz0 has quit [Quit: Connection closed for inactivity]
diphuser has quit [Remote host closed the connection]
troydm has quit [Ping timeout: 240 seconds]
noplamodo has quit [Ping timeout: 260 seconds]
ryanartecona has quit [Quit: ryanartecona]
MercurialAlchemi has joined #ocaml
noplamodo has joined #ocaml
infinity0 has joined #ocaml
moei has quit [Quit: Leaving...]
cschneid has quit [Ping timeout: 245 seconds]
noplamodo has quit [Ping timeout: 264 seconds]
cartwright has quit [Ping timeout: 255 seconds]
cschneid has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
cartwright has joined #ocaml
noplamodo has joined #ocaml
nullifidian has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
nullifidian has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
maarhart has joined #ocaml
maarhart has quit [Client Quit]
maarhart has joined #ocaml
Simn has joined #ocaml
maarhart has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
mengu has quit [Quit: Leaving...]
copy` has quit [Quit: Connection closed for inactivity]
moei has joined #ocaml
alfredo has joined #ocaml
kevin23 has joined #ocaml
<octachron>
Drup, I agree. My plan is to try to get https://github.com/ocaml/ocaml/pull/594 integrated for 4.06 and then extend the included description of variance from this point
argent_smith has joined #ocaml
AltGr has joined #ocaml
sfri has quit [Remote host closed the connection]
sfri has joined #ocaml
johnelse is now known as johnel_away
johnel_away is now known as johnelse
zpe has joined #ocaml
beginner has joined #ocaml
<beginner>
i have a small byte code program which i want to translate to js. What is the best approach so i can call this program with the correct arguments in the browser?
<def`>
jsoo?
<beginner>
def`: can you elaborate a bit further :)
<beginner>
def`: i looked at that, but i find it rather very bad at explaining what to do
<johnelse>
beginner: It depends when you want your program to run. You can hook it up to the document's onload handler with something like "Dom_html.window##.onload := Dom_html.handler (fun _ -> main_fn ())"
<johnelse>
or do similar to hook it up to e.g. a button
ski has quit [Ping timeout: 255 seconds]
<johnelse>
the question is, where do you want the arguments to come from? you're not running the program in the same way as you would when invoking it from the terminal, say
<beginner>
johnelse: at the moment i would be happy if i could do something like bin --version and see the output in the console
<johnelse>
your program is going to be running within an html document, so it needs to get its arguments from the DOM somehow
<beginner>
i have very little experience with javascript stuff, so i am not sure how i can say something like bin --version in the browser
<johnelse>
if you're working in the browser, typically you'd add the .js file as a <script> tag in a webpage, then you need to figure out how it's going to integrate with that page
<johnelse>
alternatively you can just compile a standalone program to javascript and run that under node.js
ski has joined #ocaml
<beginner>
i included the js file but then i get the error message that i dont provide enough arguments
<beginner>
if i would know the name of the function that is executed, could i then not wrap that into another js function that i can pass the correct arguments?
<johnelse>
there's not a specific function that the browser will call by default, it'll just run whatever you've put in the top level of your code (e.g. anything starting with "let () = ...")
argent_smith1 has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
<orbifx[m]>
def`: HM type inference?
<orbifx[m]>
zozozo: do modules not cover that to a digree?
<orbifx[m]>
companion_cube: anything to read on how affine types & traits compare to functors and GADTs?
<theblatte>
orbifx[m]: HM = Hindley-Milner
<companion_cube>
well they are different things? :D
<companion_cube>
but you can read stuff comparing Haskell's type classes to ML modules
<companion_cube>
that' more or less similar to traits vs OCaml's modules
Muzer has quit [Ping timeout: 260 seconds]
<zozozo>
orbifx[m]: well to some degree, but some of the functionality of Interfaces are covered by modular implicits if i recall correctly (but, indeed, you can emulate these functionnality using functors explicitly)
<zozozo>
well, traits rather than Interfaces, :p
<orbifx[m]>
Any nice and concise type-theory books or articles?
<orbifx[m]>
A lot of nice and interesting things were mentioned, I get excited and then realise I've got 20-30 minutes to get a conceptual understanding of these :P
<def`>
You should at least plan a few weeks.
<orbifx[m]>
:P
<orbifx[m]>
if I can at least do it efficiently
<orbifx[m]>
any directions?
<def`>
the book Types And Programming Languages from Benjamin Pierce is a good introduction to practical type theory
sh0t has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<orbifx[m]>
concise?
<apache2>
It starts from bottom up, I was able to read most of it with no formal background
<orbifx[m]>
Ok
<orbifx[m]>
will see into getting it
<orbifx[m]>
Other suggestions wellcome
Muzer has joined #ocaml
g0d355__ has quit [Ping timeout: 245 seconds]
jabesed has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
al-damiri has joined #ocaml
beginner has quit [Remote host closed the connection]
freusque has joined #ocaml
MercurialAlchemi has joined #ocaml
FreeBirdLjj has joined #ocaml
<octachron>
synctatic fun fact of the day: "let x = 1 in -x" ≢ "-(1)"... so much complexity for a such a small character
<Drup>
I'm tempted to call that a bug
<Drup>
even if *nobody* should rely on that
<theblatte>
hmm? let x = 1 in -x = -(1);; -> - : bool = true
<def`>
theblatte: in the ast :P
<Drup>
theblatte: type that before: "let (~-) = incr"
<Drup>
and then try
<theblatte>
hah :D
<def`>
there is a special case for constants, even if they appear inside ()
<theblatte>
lolz
<Drup>
but yeah, the handling of unary minus is a bit messy in the parser :/
spew has joined #ocaml
<octachron>
there is also the interesting difference of precedence level between (- x) and (~- x)
<Drup>
well, you can do `f ~- 3` but not `f - 3`, which is sort of expected
<Drup>
(horrible to handle in LALR, but expected)
<octachron>
there is also (~- x #+ y ) ≢ ( - x #+ y )
<Drup>
octachron, the human fuzzer.
sh0t has joined #ocaml
<orbifx[m]>
Is there a solution, preferably in OCaml, for handling process instances? Systemd, but something that can be packaged with an app
<octachron>
this one of the fun moment writing documentation, noticing all the little things that one didn't want to know
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
ryanartecona has joined #ocaml
spew_ has joined #ocaml
spew has quit [Ping timeout: 260 seconds]
jabesed has quit [Remote host closed the connection]
<companion_cube>
seems to be in between reddit and HN
TheLemonMan has joined #ocaml
<companion_cube>
(less clustered than reddit but tags, unlike HN; also smalleR)
spew has quit [Quit: foobar]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
diphuser has joined #ocaml
<orbifx[m]>
Hmm
ryanartecona has quit [Quit: ryanartecona]
kolko_ has quit [Ping timeout: 260 seconds]
AlexRussia has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
spew has joined #ocaml
zpe has joined #ocaml
slash^ has quit [Remote host closed the connection]
kakadu has joined #ocaml
shinnya has joined #ocaml
zpe has quit [Remote host closed the connection]
<orbifx[m]>
How come readdir returns an array and not a Set for example?
<orbifx[m]>
#logarion:matrix.org
<orbifx[m]>
oops sorry
nullifidian has quit [Ping timeout: 240 seconds]
<orbifx[m]>
companion_cube: could your containers become part of Batteries?
<companion_cube>
not really
<companion_cube>
not the same license, not the same philosophy
<companion_cube>
I tried contributing to batteries a while ago, but it's hard to make things change
<orbifx[m]>
explain?
ski has quit [Ping timeout: 268 seconds]
ski has joined #ocaml
g0d355__ has joined #ocaml
<companion_cube>
it's a bit long to explain, it was on the mailing list
<companion_cube>
(mostly, the issues I had were modularity and some "bad" modules: IO, Enum)
<flux>
regardless, I think containers would feel out of place inside batteries, no?
<companion_cube>
there could be a merge, in theory, but some maintainers of batteries are (understandably) reluctant to break compatibility on some critical things
<flux>
given I don't think you kept thinking "how this would fit extlib/batteries" when you were writing containers, were you :)
<companion_cube>
heh
<companion_cube>
well I did try to change batteries, but it didn't lead anywhere
<orbifx[m]>
Inactive team or difference of opinion?
<companion_cube>
difference of opinions, inertia, retrocompatibility concerns
<orbifx[m]>
That's a shame in a way, but not the end of the world.
<orbifx[m]>
regarding Sys.readdir, is there another library for dealing with files? I find it strange that readdir returns arrays
<companion_cube>
CCIO.File.walk? ;-)
<flux>
the Unix-module probably provides the low-level primitives
<orbifx[m]>
Let's see if I will find CCIO strange :P
<orbifx[m]>
flux: huh?
<flux>
Unix.opendir, Unix.readdir, etc
<orbifx[m]>
Ow I see what you mean
nullifidian has joined #ocaml
<orbifx[m]>
I would expect the files to be returned as a set
<flux>
..though probably companion_cube's suggestion is still nicer to use
<orbifx[m]>
I guess they are an array because they don't want to perform ordering without reason
<flux>
well, that's an idea I haven't seen in any interface :)
<flux>
arrays are ordered..
<companion_cube>
indeed, it's more costly and not always what the caller wants
<flux>
I mean they could be a list. but array is probably slightly more efficient.
<orbifx[m]>
companion_cube: do you have a convention for when something is mutable in your library?
<companion_cube>
it's a C array underneath, so they know the length
<orbifx[m]>
flux: spacewise?
<companion_cube>
orbifx[m]: erf, not particularly
<companion_cube>
'a gen is mutable (by design)
<orbifx[m]>
also, is gen meant to be a lazy approach?
<companion_cube>
indeed
<companion_cube>
there read_dir and walk_l also
<orbifx[m]>
cool
<orbifx[m]>
Good to know about these, wasn't aware
shinnya has quit [Ping timeout: 255 seconds]
<companion_cube>
(honestly I use directories only rarely, so this part of the API could be improved)
<companion_cube>
the very basics of CCIO, however, are nice (imho)
<orbifx[m]>
Can't migrate just now, as I'm trying to wrap up my interface, but it looks like I might need to abstract the type and offer a functor instead of a data-type interface
<orbifx[m]>
this is out of date a bit, but shows one of the ideas I was experimenting with
<companion_cube>
right, a map cna do, too
<orbifx[m]>
I think although simpler to use once finished, it's less flexible and wasteful
<orbifx[m]>
My latest idea is to use a functor to hide the actual "backend" type, whether it be array, list, or anything, so long certain functions are available for it.
<orbifx[m]>
And then provide a monad atop of that, called archive, which can perform the transformations which may be needed
<orbifx[m]>
In a safe way
<companion_cube>
sounds ok
<orbifx[m]>
Would that be the neatest design, or am I missing something?
<orbifx[m]>
ok? :P
<companion_cube>
I think irmin requires lwt, though?
<companion_cube>
so you'd probably have to use Lwt as a monad underneath
<orbifx[m]>
I look into that later, it can be put inside the monad
<orbifx[m]>
yeah
<orbifx[m]>
I think the monadic part I'm happy with. It's the functor I'm not sure if it's the correct design or if one should aim for an "abstracted" structure
<orbifx[m]>
What do you think?
<companion_cube>
you could also use first-class modules (instead of functorizing everything)
<companion_cube>
but the choice is yours, really, depends on your taste
<orbifx[m]>
I haven't caught up with the difference of first-class modules and functor modules; could you briefly describe it?
<companion_cube>
a functor is a function that takes a module, and returns a module
* orbifx[m]
is searching at the same time
<companion_cube>
a first-class module is a module wrapped as a value
<companion_cube>
so you can pass a module around, chose which one at runtime, and unpack it locally before using it
<companion_cube>
there should be sth on ocaml.org too
<companion_cube>
not related to a monad, it's purely in the language
spew has quit [Ping timeout: 272 seconds]
kolko has joined #ocaml
oliverfriedmann has joined #ocaml
<oliverfriedmann>
Hi - I'm working on a OPAM package that requires the user to provide paths to outside (non-OCaml) libraries; what is the best way for a user to set configuration parameters for a particular OPAM-controlled package?
<companion_cube>
I don't know :/
<orbifx[m]>
companion_cube: do modules as values have to have the same signature to be used interchangeably?
<companion_cube>
yes
<companion_cube>
(well you can upcast)
<orbifx[m]>
oliverfriedmann: I suspect it depends on your build system
<orbifx[m]>
companion_cube: all these decisions :P how do you decide between the two? What's your critical factor?
AlexRussia has joined #ocaml
<companion_cube>
if it's going to be passed everywhere but has a simple signature, I'd use 1st class modules
<companion_cube>
otherwise the whole program has to be functorized, which is a pain
<oliverfriedmann>
it is a little tricky - the user can provide 0-3 paths to outside SAT solvers; depending on which of these solvers are available, particular "bridging" OCaml files are compiled into the package, and the final project using the package needs to link to the native solver libraries as well as some C++-bridging files included in the OCaml package
<oliverfriedmann>
currently, this works without OPAM by creating a simple config file that has all links to the outside solvers, and a bigger Makefile puts the different pieces together
larhat has quit [Quit: Leaving.]
<companion_cube>
you might want to send a mail to the opam mailing list :-)
<companion_cube>
that's an interesting problem
<oliverfriedmann>
copy that - just wanted to make sure this is not a totally greenhorn-ish request ;-)
<orbifx[m]>
companion_cube: it will be hidden inside the monad, the rest of the program should not know about the store
<orbifx[m]>
but I like the idea of being able to interchange between stores at runtime; can functors do that?
<companion_cube>
not really
<companion_cube>
sounds like you want 1st class modules indeed…
<companion_cube>
(or record of functions)
<companion_cube>
(or objects)
<orbifx[m]>
not going fo objects, even if they are just like record of functions :P
<companion_cube>
^^
<orbifx[m]>
do 1st class module incur any runtime penalties? I pressume their types are stripped just like other values?
<companion_cube>
a module is just a record at runtime
<orbifx[m]>
so in terms of functionality 1st class modules >= functors?
kakadu has quit [Remote host closed the connection]
<companion_cube>
the question doesn't really make sense, I think :3
<companion_cube>
read carefully about both, think about it
<orbifx[m]>
will do; couldn't find it on opam.org on a first pass of tutorials. Did you mean the reference manual?