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
govg has quit [Ping timeout: 258 seconds]
govg has joined #ocaml
ziyourenxiang has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
silver has quit [Read error: Connection reset by peer]
Jeanne-Kamikaze has quit [Remote host closed the connection]
<oni-on-ion> how come i can't use (libraries abc hello) in utop like "Abc.Something.x" like i can in source files ? (abc.ml does not exist)
<oni-on-ion> and/or how do i recreate and/or simulate this behavior
<companion_cube> `dune utop path/to/abc` ?
demond has joined #ocaml
demond has left #ocaml [#ocaml]
demond has joined #ocaml
demond has left #ocaml ["++++++++++++++"]
vsui has joined #ocaml
<oni-on-ion> ohh! lets see. did not know about that
vsui has quit [Ping timeout: 248 seconds]
mfp has quit [Ping timeout: 252 seconds]
vsui has joined #ocaml
vsui has quit [Ping timeout: 248 seconds]
keep_learning_M has joined #ocaml
gravicappa has joined #ocaml
vsui has joined #ocaml
jao has quit [Ping timeout: 248 seconds]
vsui has quit [Ping timeout: 248 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
rwmjones_ has joined #ocaml
rwmjones has quit [Ping timeout: 248 seconds]
_whitelogger has joined #ocaml
ggole has joined #ocaml
vsui has joined #ocaml
vsui has quit [Ping timeout: 252 seconds]
kapilp has joined #ocaml
_whitelogger has joined #ocaml
gravicappa has quit [Ping timeout: 258 seconds]
vsui has joined #ocaml
vsui has quit [Ping timeout: 246 seconds]
ravenousmoose has joined #ocaml
Haudegen has joined #ocaml
barockobamo has joined #ocaml
barockobamo has quit [Remote host closed the connection]
Serpent7776 has joined #ocaml
nullifidian_ is now known as nullifidian
syb has joined #ocaml
syb has quit [Max SendQ exceeded]
syb has joined #ocaml
syb has quit [Remote host closed the connection]
vsui has joined #ocaml
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravenousmoose has joined #ocaml
gahr has quit [Quit: leaving]
gahr has joined #ocaml
kakadu has joined #ocaml
mfp has joined #ocaml
tane_ has joined #ocaml
vsui has quit [Ping timeout: 268 seconds]
<Leonidas> Fardale: yes, but where are the Dockerfiles that generate these images?
dimitarvp has joined #ocaml
dimitarvp has quit [Client Quit]
mal`` has quit [Quit: Leaving]
mal`` has joined #ocaml
silver has joined #ocaml
vsui has joined #ocaml
zolk3ri has joined #ocaml
zolk3ri has quit [Ping timeout: 256 seconds]
zolk3ri has joined #ocaml
jao has joined #ocaml
jao is now known as Guest34562
vsui has quit [Ping timeout: 272 seconds]
vsui has joined #ocaml
Guest34562 is now known as jao
gravicappa has joined #ocaml
narimiran has joined #ocaml
<narimiran> hi guys, i just started exploring ocaml and for the last two hours i'm unsuccessfully trying to see how to read from a multiline file. lots of resources mention "Core.Std" but i'm not able to compile my file when i use "open Core.Std". is there another way without 3rd party modules, or how can i compile it?
<narimiran> there is "input_line" when reading from a single-line file, but i haven't seen a multiline variant (which would return "string list", i guess)
vsui has quit [Ping timeout: 252 seconds]
<narimiran> when i do "ocamlfind ocamlopt -package core day02.ml" i get "Error: No implementations provided for the following modules: ........."
<octachron> narimiran, dune should be easier to use: https://dune.readthedocs.io/en/latest/quick-start.html
<narimiran> octachron: thanks for the suggestion, i'll try dune
<octachron> otherwise, you can write a short input_multiline function by reading lines one-by-one until the End_of_file exception is raised
<kandu> octachron: you may want to run: ocamlfind ocamlopt -thread -linkpkg -package core day02.ml -o day02
<kandu> octachron: sry,
<kandu> narimiran: ^^
<narimiran> kandu: thanks! i've tried several variants of that, but nothing worked. copy-pasting your line seems to work :)
<octachron> for comparison the corresponding dune file is: (executable (name day02) (libraries core) )
<narimiran> thank you both kandu and octachron!!
<narimiran> octachron: do i have to write a dune file for every .ml file or can i have one per project? (so all files will know where to find Core) if not, then kandu's solution might be easier to automate/generalize
<octachron> one by subproject/directory
<octachron> I would advise to use dune which is the more future-proof option
<narimiran> ok, can you show me an example with dune file which will load Core for all files in a directory? is it this: https://jbuilder.readthedocs.io/en/latest/quick-start.html#defining-a-library-using-lwt-and-ocaml-re ?
<octachron> Are all files part of the same executable? The same library?
<octachron> Distinct executables?
<narimiran> octachron: these are just advent of code tasks i use to practice learning a new language. so basically it will be day01.ml, day02.ml, and so on; but they are independent
<octachron> then you need one dune file with one line by executable: (executable (name day02) (libraries core) (modules Day02))
<narimiran> and every file should be in a separate directory? i cannot have them all in a same directory?
<narimiran> and i'll need an .opam file?
<narimiran> (sorry if these are stupid questions, it is literally my first day of using ocaml)
<notnotdan> nah narimiran your questions are not stupid
<notnotdan> you don't need an .opam file unless you plan on publishing your project on opam
<notnotdan> the ecosystem for OCaml is similar to that of C where you have different tools for dependency management and build scripts and so on, so it can be quite confusing to navigate at first
<octachron> narimiran, you can keep in the same directory with the (module Day02) flag
<narimiran> octachron: ok, i'll explore dune a bit more before asking more questions (currently i can't make it work, but it is probably my fault)
jao has quit [Ping timeout: 272 seconds]
vsui has joined #ocaml
vsui has quit [Ping timeout: 268 seconds]
<narimiran> oni-on-ion: thanks! in the end i've settled on "Core.In_channel.read_lines" (without "open Core" as that messed up my other functions, e.g. List.fold_left)
<oni-on-ion> narimiran, ahh, ok =) just entered. havent looked at Core yet myself
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<narimiran> btw, is there a better way than `print_int some_int; print_endline ""`? (i find converting int to string and then using print_endline in the same league :P)
<oni-on-ion> Print.format ?
<oni-on-ion> Printf.printf
<oni-on-ion> (also print_newline == print_endline "")
<narimiran> ok, newline instead of endline"" makes it already 17% nicer :D
<oni-on-ion> hehe
<oni-on-ion> print_endline (string_of_int x) ?
<narimiran> that's "the same league" that i mentioned earlier ;)
<narimiran> i did some searching and from what i've found it seems that function composition (`>>` in fsharp) is discouraged in ocaml, true?
<oni-on-ion> nah i see it often, im just not sure what library its in so i can use it in my own code =)
<oni-on-ion> string_of_int x >>= print_endline
AtumT has joined #ocaml
vsui has joined #ocaml
Jeanne-Kamikaze has joined #ocaml
ziyourenxiang has quit [Ping timeout: 257 seconds]
AtumT_ has joined #ocaml
AtumT has quit [Ping timeout: 272 seconds]
oni_on_ion has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
iovec has joined #ocaml
oni_on_ion has left #ocaml [#ocaml]
oni-on-ion has joined #ocaml
philt has joined #ocaml
vsui has quit [Ping timeout: 244 seconds]
nopf has quit [Ping timeout: 272 seconds]
nopf has joined #ocaml
SpiceGuid has joined #ocaml
SpiceGuid has quit [Quit: ChatZilla 0.9.93 [SeaMonkey 2.49.4/20180713174829]]
Jeanne-Kamikaze has quit [Quit: Leaving]
vsui has joined #ocaml
vsui has quit [Ping timeout: 272 seconds]
gravicappa has quit [Ping timeout: 248 seconds]
q9929t has joined #ocaml
q9929t has quit [Client Quit]
jao has joined #ocaml
dmiles has quit [Ping timeout: 252 seconds]
AtumT_ has quit [Ping timeout: 245 seconds]
AtumT has joined #ocaml
dmiles has joined #ocaml
govg has quit [Ping timeout: 258 seconds]
Jeanne-Kamikaze has joined #ocaml
vsui has joined #ocaml
kapilp has quit [Quit: Connection closed for inactivity]
govg has joined #ocaml
vsui has quit [Ping timeout: 248 seconds]
vsui has joined #ocaml
vsui has quit [Ping timeout: 268 seconds]
Netsu has joined #ocaml
<Netsu> Hello there. Here https://gist.github.com/Pitometsu/d5f98078de340ccfb1f929a0da9aac73 I'm trying to do exercise to understand relations between existentias, type classes and gadt. What I miss is how to implement type singletones. So could such example be better?
<octachron> "type 'a typ = Int: int typ"? It is hard to grasp what you are trying to do
vsui has joined #ocaml
vsui has quit [Ping timeout: 246 seconds]
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 258 seconds]
govg has quit [Remote host closed the connection]
<Netsu> octachron: thanks. Maybe not exactly singleton types. I thought about single value per type (e.g. single `someSuch` value for `int` type or int wrapper). Maybe it related to some dependent type abilities, however not sure, have OCaml type system enough power here.
govg has joined #ocaml
weird_error has joined #ocaml
weird_error has quit [Quit: weird_error]
ggole has quit [Quit: Leaving]
<Netsu> or type indexed values rather
narimiran has quit [Ping timeout: 268 seconds]
vsui has joined #ocaml
vsui has quit [Ping timeout: 272 seconds]
zolk3ri has quit [Remote host closed the connection]
tane_ has quit [Quit: Leaving]
Serpent7776 has quit [Quit: leaving]
<octachron> Netsu, as a general advice, imitating haskell type classes is not particularly pleasant. Beyond that I am not sure why you are not using the simpler record/object/module type encoding.
rwmjones_ is now known as rwmjones
unyu has quit [Quit: unyu~]
vsui has joined #ocaml
vsui has quit [Ping timeout: 272 seconds]
kakadu_ has quit [Remote host closed the connection]
vsui has joined #ocaml
vsui has quit [Ping timeout: 272 seconds]
weird_error has joined #ocaml
weird_error has quit [Client Quit]
glass has joined #ocaml
theglass has quit [Ping timeout: 257 seconds]
vsui has joined #ocaml
iovec has quit [Quit: Connection closed for inactivity]
vsui has quit [Ping timeout: 258 seconds]
unyu has joined #ocaml