adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
iovec has quit [Quit: Connection closed for inactivity]
AtumT_ has quit [Quit: AtumT_]
<oni-on-ion> Int.t ?
<oni-on-ion> hm not. how come just 'int' does not work ?
<int-e> there was an opened module with its own 'int' type.
<oni-on-ion> ohh. can shadow one of them ?
<int-e> I worked around the problem by defining type ml_int = int;; before opening the other module. (the other module is generated by Coq, so it's not so easy to change the type name there; and earlier Coq versions didn't generate that type...)
keep_learning_M has joined #ocaml
<oni-on-ion> yea, ok that is shadowing. great
<oni-on-ion> perhaps the intention for this version of Coq to not use 'open'
kvda has joined #ocaml
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
troydm has joined #ocaml
<int-e> Yeah, but when adapting existing code there's always this trade-off between doing things quickly and doing things properly... I'm in quick mode currently.
<oni-on-ion> okay. i just know that current convention is qualify the module (Fromcoq.int) rather than (open Fromcoq)
<int-e> yeah that makes sense
silver has quit [Read error: Connection reset by peer]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alphor has quit [Quit: Bye!]
kvda has joined #ocaml
Jeanne-Kamikaze has joined #ocaml
mfp has quit [Ping timeout: 244 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
caltelt_ has joined #ocaml
kvda has joined #ocaml
gravicappa has joined #ocaml
_whitelogger has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
<xvilka> oni-on-ion: seems not yet, sadly
<xvilka> https://github.com/ocaml/ocaml/issues - check the count of open ones
<xvilka> is this a sign?
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
kvda has quit [Client Quit]
Jeanne-Kamikaze has quit [Quit: Leaving]
kvda has joined #ocaml
narimiran has joined #ocaml
<oni-on-ion> xvilka, oh.. i dont know. 4.08 rc1 is in opam
<oni-on-ion> idk what is new until release because i cant find info, except monadic let which seems great
iovec has joined #ocaml
clog has quit [Ping timeout: 248 seconds]
<xvilka> oni-on-ion: one of the greatest achievments of this release is a switch to merlin as a compiler parser, thus improving syntax errors reports
<xvilka> including annoying PPX ones
<oni-on-ion> interesting.. using merlin in emacs right now then is equivalent functionality
<oni-on-ion> ?
<xvilka> oni-on-ion: well, kind of
<xvilka> and certainly it is uniform now
<oni-on-ion> hm yeah =)
<oni-on-ion> i was looking through these : https://twitter.com/etiennemillon/status/1095250528467079169
<oni-on-ion> specifically -> https://github.com/ocaml/ocaml/pull/2129
<oni-on-ion> coming from haskell i am happy
<oni-on-ion> "monadic let" already in ppx_let , so just another inclusion. but great to have it in main
jao has quit [Ping timeout: 248 seconds]
<xvilka> oni-on-ion: yes, it is a good thing to have. I don't like this syntax though
<xvilka> it feels weird a bit
caltelt_ has quit [Ping timeout: 248 seconds]
<oni-on-ion> how come?
clog has joined #ocaml
ggole has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
clog has quit [Ping timeout: 246 seconds]
clog has joined #ocaml
Birdface has joined #ocaml
ShalokShalom has joined #ocaml
ShalokShalom has left #ocaml [#ocaml]
mfp has joined #ocaml
Haudegen has joined #ocaml
jnavila has joined #ocaml
ravenousmoose has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
jbrown has quit [Remote host closed the connection]
jnavila has quit [Ping timeout: 246 seconds]
Birdface has quit [Ping timeout: 276 seconds]
pierpal has joined #ocaml
niceplace has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
niceplace has joined #ocaml
iovec has quit [Quit: Connection closed for inactivity]
quarters has quit [Ping timeout: 252 seconds]
quarters has joined #ocaml
quarters has quit [Ping timeout: 252 seconds]
quarters has joined #ocaml
seastack has quit [Remote host closed the connection]
quarters has quit [Ping timeout: 252 seconds]
seastack has joined #ocaml
quarters has joined #ocaml
monstasat has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
<companion_cube> you meant menhir, not merlin, xvilka ?
<monstasat> Hi! Is it possible to use Weak module on js side (with jsoo)?
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 272 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
spew has joined #ocaml
kapilp has joined #ocaml
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravenousmoose has joined #ocaml
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FreeBirdLjj has joined #ocaml
ravenousmoose has joined #ocaml
jao has joined #ocaml
q9929t has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<def`> monstasat: as far as I know, Javascript GC is not expressive enough
<monstasat> def`: So, does Weak array work like hashtable on the javascript side?
<def`> rather like a normal array I guess?
<spew> si
<spew> woops
<companion_cube> hunter2
FreeBirdLjj has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
monstasat has quit [Remote host closed the connection]
<narimiran> anybody here uses https://github.com/akabe/ocaml-jupyter ?
<companion_cube> nope
<companion_cube> (I use https://github.com/ocaml-jupyter/jupyter-kernel/ with another kernel :D)
<narimiran> companion_cube: can you `open <Modulename>` in that one?
<companion_cube> nope, it's not for pure OCaml :s
<narimiran> because even the documentation in "mine" shows `#require ....`, when i try to do that, i get "Unknown directive `require'."
<companion_cube> erf, they may use the wrong parser then :s
<companion_cube> oh wait, did you `#use "topfind";;` first?
<narimiran> i didn't. i tried it now and i get: "Cannot find file topfind."
<companion_cube> I don't know what ocaml compiler it uses, maybe it's on a switch without ocamlfind?
<narimiran> i just started with ocaml last weekend, so any help/guide would be great
<companion_cube> I'm not sure a lot of people use jupyter :s
<narimiran> it is nicer than `ocaml` on the command line, easier to edit stuff and experiment, etc. but ok, i think i can live without importing anything for now....
<narimiran> i was trying to follow 'real world ocaml' where they use Base/Core
<companion_cube> on the command line, though, everyone uses `utop` :)
<narimiran> oh, let me try it
<narimiran> oooh, up and down arrows work. this changes everyting!! :)
<narimiran> now i know why nobody uses jupyter :D thanks companion_cube for the tip :)
<companion_cube> also it has some completion :)
<companion_cube> (if you use dune, look up `dune utop` for loading a current project into utop, too)
<narimiran> i haven't used it yet, but i heard people recommending it so i'll give it a try at some point. (currently i use `ocamlbuild`)
<companion_cube> heh, ok :D
<narimiran> any other "must have" tips for a beginner?
<companion_cube> hmm, try to avoid imperative, at least at first
<Armael> setup your text editor to have merlin and ocp-indent
<companion_cube> ah yes, merlin ♥
<narimiran> companion_cube: hehe, i have some minor experience with F#, so i know about that tip :)
<companion_cube> ah nice!
<narimiran> Armael: yep, i've set up vim based on some instructions i found so i have code completion and syntax highliting
<Armael> did you setup merlin? it does typechecking on the fly, gives you the type under your cursor, etc
<companion_cube> (I guess it's what provides completion in the advice, or at least I'd hope so)
AtumT has joined #ocaml
<narimiran> Armael: i have this "nmap <leader>tt :MerlinTypeOf<CR>" so it gives me types when i request it; i don't have type under cursor
<Armael> yeah ok that's what I'm talking about
<narimiran> is this ok for .ocamlinit? http://ix.io/1Ku7
<narimiran> because when i open that file in vim, i'm greeted with some error messages about merlin
<narimiran> also, is Jane Street stuff (Base/Core) what everyone uses, so you always have named parameters, etc.?
<companion_cube> the community is split
<Armael> I don't use a .ocamlinit personally
<Armael> (you can probably get rid of the #camlp4o line btw)
<narimiran> Armael: it was automatically created after installation, IIRC
<narimiran> ooooh, utop saves history from a previous session. and i explored a bit its options. it really is a gamechanger
<companion_cube> :D
<companion_cube> ctrl-r ftw
hockpa2e has joined #ocaml
hockpa2e has quit [Remote host closed the connection]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ziyourenxiang has quit [Ping timeout: 248 seconds]
Serpent7776 has joined #ocaml
iovec has joined #ocaml
q9929t has quit [Quit: q9929t]
<narimiran> is there maybe a way to see a function's type in utop? something like `List.map?` or something similar
<companion_cube> just type `List.map;;` <enter> and it's tell you the type
<companion_cube> functions are values
<narimiran> ah yeah, stupid question :) i knew that one ;)
<narimiran> it's because i started typing "is there a way to see function documentation", then i realized i'm asking too much, so instead of deleting it, i decided to embarrass myself :)
Anarchos has joined #ocaml
<companion_cube> heh, fair question, but afaik utop doesn't have access to documentation
<Anarchos> how to use ocamldebug on programs which use fork () ? At each fork call, ocamldebug doesn't answer in terminal...
gravicappa has quit [Ping timeout: 258 seconds]
jnavila has joined #ocaml
gravicappa has joined #ocaml
keep_learning_M has quit [Quit: This computer has gone to sleep]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
<oni-on-ion> companion_cube, re: menhir, that makes more sense.
<companion_cube> doesn't it? :D
<oni-on-ion> and i remember reading this before last night as well. because 4.08 has source snippet in errors/warnings now so merlin seems redundant =)
<companion_cube> tss tss what about completion and type query and jump to source, hmm? :p
<oni-on-ion> all merlin happiness =)
jnavila has quit [Ping timeout: 246 seconds]
jnavila has joined #ocaml
ygrek has joined #ocaml
jbrown has joined #ocaml
narimiran has quit [Ping timeout: 272 seconds]
assertionerror has joined #ocaml
<assertionerror> Hello, everyone. I am a novice user of Dune and I am trying to troubleshoot a ocamllex problem. I have a file "lexer.mll" and a line (ocamllex (modules lexer)) in my "dune" file. So far so good. When I run dune it generates a file "lexer.ml". The problem is that the module Lexer is not visible. When I run on another file Lexer.next_line ocamlc complains about an unbound value.
<assertionerror> Although I can see that the function is defined in _build/default/src/lexer.ml
<assertionerror> I am wondering if there is some dependency flag I should add to my (executable) thingy.
<companion_cube> is the other file in the same directory?
<assertionerror> They are all in the same directory.
<companion_cube> you can look in _build/log for some info on what dune does
<companion_cube> in my experience you shouldn't have to do anything to use `Lexer.next_line`
bartholin has quit [Ping timeout: 248 seconds]
<companion_cube> (is there a lexer.mli file? check that the value is not hidden)
<assertionerror> No there isn't.
<companion_cube> none is generated?
<assertionerror> Right, I am using "read" which is the rule I created. I just didn't want to use a confusing name.
<assertionerror> $ ls _build/default/src/lexer.mli
<assertionerror> ls: cannot access '_build/default/src/lexer.mli': No such file or directory
<companion_cube> you could try to specify `(modules mymain lexer)` in the executable stanza, I guess, and see where it breaks
<assertionerror> My main is called "main": (executable (name main) (libraries sexplib))
<companion_cube> with main.ml?
<assertionerror> companion_cube: I've added a (module ...). Then ocamlc started complaining about missing modules. After I added all modules names in my project (which correspond to each module.ml) the same error appeared.
<companion_cube> are you running ocamlc yourself??
<assertionerror> No. I am running dune.
<companion_cube> that's pretty weird.
<companion_cube> `dune clean` may help remove old files, btw
<assertionerror> Here is my project if you are curious: https://gitlab.com/cogumbreiro/faial/blob/master/src/dune
<companion_cube> ahah I know
<companion_cube> `open Sexplib` shadows your Lexer
<companion_cube> and this is why `open` sucks
bartholin has joined #ocaml
<companion_cube> (I think the usual thing janestreet recommends is `open Sexplib.Std`? but not sure)
<companion_cube> personnally I'd `module S = Sexplib` or something similar, I try to avoid open
<assertionerror> Thanks!
<assertionerror> I actually stumbled upon this error before. My parser was called parser.ml and I had to rename it to parse.ml
<companion_cube> (with merlin, you could ask for the "type" of Lexer)
<assertionerror> I had no idea as to why that worked though :-)
<companion_cube> (and it should show something like `module Lexer = Sexplib.Lexer`)
<companion_cube> well `open` is tricky :p
<companion_cube> (you can also do : `module L = Lexer` *before* you open other libs)
<assertionerror> I need to fix my opens :-S
<assertionerror> Thanks a bunch!
<companion_cube> ✔
jnavila has quit [Ping timeout: 259 seconds]
gravicappa has quit [Ping timeout: 248 seconds]
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
jnavila has joined #ocaml
assertionerror_ has joined #ocaml
assertionerror has quit [Ping timeout: 252 seconds]
assertionerror_ is now known as assertionerror
assertionerror has quit [Client Quit]
assertionerror has joined #ocaml
<Kitambi> "let open ... in" might help you, fwiw
kakadu has joined #ocaml
ggole has quit [Quit: Leaving]
jbrown has quit [Ping timeout: 258 seconds]
<assertionerror> Kitambi: thanks! I will use that.
tristero has joined #ocaml
assertionerror has quit [Ping timeout: 264 seconds]
jbrown has joined #ocaml
Serpent7776 has quit [Quit: leaving]
assertionerror has joined #ocaml
theglass has quit [Quit: ZNC - http://znc.in]
jnavila has quit [Ping timeout: 245 seconds]
<Leonidas> companion_cube: the `.Std` module has been deprecated for a long time, that was before the release of v0.9
<companion_cube> so… they suggest to dump all their submodules in the global namespace? :/
<Leonidas> not worse than the regular standard library already does
<companion_cube> well the stdlib is… standard
<Leonidas> not for me anymore :p
<thizanne> but the point of jane street libs is to replace it
<companion_cube> your choice :p
<companion_cube> thizanne: the point of sexplib is to replace the stdlib?
<Leonidas> yeah, I'm kinda into List modules that don't explode
<thizanne> not sure for sexplib, I don't use it, but i'd bet the point is indeed to replace the exported modules ?
<Leonidas> I guess `open Sexplib` is not the expected usage to begin with
<Leonidas> `open Core`/`open Base`/`open Async` is
<companion_cube> Leonidas: some extensions of the stdlib that I won't name also provide safer alternatives 😇
<thizanne> because they're extensions, not replacements
<Leonidas> yeah, but they are opt-in
<companion_cube> so is base/core?
<thizanne> speaking of which I still have "resuscitating batteries" on my todo list
<companion_cube> please don't :s
<Leonidas> well, only the first open, then the rest of the module requires opting out
<companion_cube> same as stdlib extensions?
<Leonidas> maybe it could be cool to have an implicit open of core/base. I don't know.
<companion_cube> (flags :standard -open base)
<Leonidas> yes.
<companion_cube> thizanne: batteries should be dissected into smaller components… oh wait that would have been batteries 3
<companion_cube> 🙄
<thizanne> batteries 3 for me is getting rid of enum and io
<Leonidas> well, not that extlib was revived :D
<companion_cube> thizanne: and unix
<Leonidas> *now that
<thizanne> and i have this work from my student to partly solve point 1
<companion_cube> like, using `seq`?
<companion_cube> ok I need to leave before accumulating too much salt, anyway
<thizanne> basically yeah
<thizanne> so yeah nothing difficult except nobody (me included) wants to spend a few hours on getting this done properly
<Leonidas> if you dissect batteries into smaller components, without enum, io and unix... you basically get dbunzlis libs
<thizanne> the lib will probably die anyway
<thizanne> but against all odds it's not done yet so I guess it's still worth trying a few things before
<Drup> thizanne: why not use containers at that point ... ?
<Leonidas> I don't really see the point. better salvage the useful parts whatever these might be at this point and let it rest in peace
<thizanne> no idea Drup
<thizanne> but it seems some people are staying on batteries
<Leonidas> inertia?
<thizanne> right now I'm trying base/core_kernel on a few projects, and I actually like it
<Drup> base is decent
<Leonidas> my slack code also uses Lwt, mostly for inertia reasons
<thizanne> base lacks a few annoying modules
troydm has joined #ocaml
<Drup> Leonidas: well, why would you replace it by anything ?
<thizanne> it's probably much better as a dependency, but for a final program I like to have Tuple2 and Time, for instance
<Leonidas> I would like to use base but I always end up at least requiring Core_kernel :/
spew has quit [Quit: going home]
<Leonidas> Drup: because after using Async I dislike almost every design decision in Lwt
troydm has quit [Client Quit]
<Leonidas> (I mean, that's fair enough, given Async was written by the same person who wrote Lwt in the first place, with some lessons learned)
troydm has joined #ocaml
<Leonidas> aantron has done a great job putting in the effort of maintaining Lwt though
narimiran has joined #ocaml
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
troydm has joined #ocaml
rwmjones_ has joined #ocaml
rwmjones has quit [Ping timeout: 252 seconds]
kakadu has quit [Remote host closed the connection]
narimiran has quit [Ping timeout: 258 seconds]
assertionerror has quit [Quit: assertionerror]
assertionerror has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 248 seconds]
Haudegen has quit [Ping timeout: 248 seconds]
_whitelogger has joined #ocaml
ziyourenxiang has joined #ocaml
_whitelogger has joined #ocaml