companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.12 released: https://ocaml.org/releases/4.12.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
troydm has quit [Ping timeout: 265 seconds]
troydm has joined #ocaml
dhil has quit [Ping timeout: 258 seconds]
selimcan has quit [Quit: Leaving]
pieguy128 has quit [Quit: ZNC 1.8.2 - https://znc.in]
pieguy128 has joined #ocaml
gravicappa has joined #ocaml
JSharp is now known as JSharp_
JSharp_ is now known as JSharp__
JSharp__ is now known as jaesharp
jaesharp is now known as jaesharp_
jaesharp_ is now known as jaesharp__
jaesharp__ is now known as JSharp
JSharp is now known as Rachel
Rachel is now known as Rachel_
Rachel_ is now known as Rachel__
Rachel__ is now known as JSharp
mbuf has joined #ocaml
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
mbuf has quit [Ping timeout: 265 seconds]
mbuf has joined #ocaml
gzj has joined #ocaml
shawnw has quit [Ping timeout: 258 seconds]
<d_bot> <Cyclomatic Complexity> hey
<d_bot> <Cyclomatic Complexity> i might be bad at looking for docs
<d_bot> <Cyclomatic Complexity> but does anyone know a place where i can find all the utop #commands + descriptions?
<d_bot> <Cyclomatic Complexity> also, if I do `dune utop some/path`, and then `#pwd`, I get the wrong path
<d_bot> <octachron> `#help;;`?
<d_bot> <Cyclomatic Complexity> i was looking for it online or with `dune utop --help`, oof and thanks
cedric has joined #ocaml
<d_bot> <Cyclomatic Complexity> Is there a way to `#use` a file and `#mod_use` all of its dependencies?
cedric has quit [Client Quit]
berberman has joined #ocaml
berberman_ has quit [Ping timeout: 264 seconds]
cedric has joined #ocaml
<d_bot> <octachron> Not as far as I know
<d_bot> <Cyclomatic Complexity> are there examples online of typical utop sessions? i might be missing a thing, because using a file and not having to deal with all the `X module not found` errors seems like a very basic usecase
<d_bot> <octachron> Generally, using compiled bytecode libraries or files works better since you can `#load` and `#load_rec` them.
<d_bot> <Christophe> do you have those issues with `dune utop`? This usually loads everything nicely...
<d_bot> <Cyclomatic Complexity> @octachron I see. So in my dune, I should add a bytecode target, and build it with dune build watch in the background, right?
<d_bot> <octachron> Well without change of configuration, dune builds the bytecode by default.
<d_bot> <Cyclomatic Complexity> hmm, why doesn't it find it then 😦
<d_bot> <Cyclomatic Complexity> `Cannot find file "reactive.bc"`
<d_bot> <Cyclomatic Complexity> Possibly related to me going through esy?
<d_bot> <octachron> Did you add the path to the bytecode objects with `#dir` ?
Haudegen has joined #ocaml
mro has joined #ocaml
leah2 has quit [Ping timeout: 240 seconds]
leah2 has joined #ocaml
<d_bot> <Cyclomatic Complexity> @octachron I did `#directory "."`, doesn't change anything
<d_bot> <Cyclomatic Complexity> I did `cd my_folder`, then `esy dune utop .`, `#pwd` prints the right folder
<d_bot> <Cyclomatic Complexity> hm
<d_bot> <Cyclomatic Complexity> it doesn't print the build folder
<d_bot> <octachron> This is not the right directory of the bytecode object.
<d_bot> <Cyclomatic Complexity> Shouldn't `dune utop` put it in the build folder?
<d_bot> <octachron> Doesn't dune utop pull the library in the scope?
<d_bot> <Cyclomatic Complexity> It's an executable
<d_bot> <octachron> I would advise to make a small private library and leave only the gluing code to the executable.
<d_bot> <Cyclomatic Complexity> a
<d_bot> <Cyclomatic Complexity> ok
<d_bot> <octachron> Anyway, the bytecode objects file are in `_build/default/path_to_executable/.executable_name.eobjs/bytecode`
<d_bot> <Cyclomatic Complexity> yeah, but I don't want to enter such paths
<d_bot> <Cyclomatic Complexity> 1. because it's a pain
<d_bot> <Cyclomatic Complexity> 2. because esy has diff build paths actually
<d_bot> <Cyclomatic Complexity> so i will do the small lib thing
<d_bot> <octachron> Then it is probably better to cooperate with dune with a private lib indeed.
<d_bot> <Cyclomatic Complexity> unrelated: i remember there is like this OCaml library that can take a file.txt, and make it into a file.ml that exports a `let main : string = "contentofthefile.txt"` or something
<d_bot> <Cyclomatic Complexity> and it can do it with a whole folder
<d_bot> <Cyclomatic Complexity> practical to avoid massive read/write in tests
<d_bot> <Cyclomatic Complexity> can't recall its name, nor the keywords i should use to search for it
<d_bot> <Cyclomatic Complexity> @octachron Thanks for the private lib thing: it works!
cedric has quit [Quit: Konversation terminated!]
mro has quit [Quit: Leaving...]
glassofethanol has joined #ocaml
vizard has joined #ocaml
olle has joined #ocaml
Framacien has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
Framacien has quit [Quit: Client closed]
yoctocell has joined #ocaml
bartholin has joined #ocaml
dhil has joined #ocaml
waleee has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
zebrag has joined #ocaml
Nahra` has joined #ocaml
Nahra has quit [Ping timeout: 252 seconds]
zebrag has quit [Remote host closed the connection]
mbuf has quit [Quit: Leaving]
zebrag has joined #ocaml
zebrag has quit [Read error: Connection reset by peer]
zebrag has joined #ocaml
<d_bot> <Alistair> Is there a OCaml library for monad transformers?
Haudegen has joined #ocaml
gravicappa has quit [Ping timeout: 258 seconds]
gravicappa has joined #ocaml
mbuf has joined #ocaml
<companion_cube> this is not haskell… :p
<companion_cube> stacking monads should really be rare, imho
<companion_cube> (aside from lwt+result, that is)
<d_bot> <Alistair> I've got alot of results and state being passed about my type inference algorithm, using transformers will clean up my current approach
<d_bot> <EduardoRFS> lwt+result is already bad enough tho
<companion_cube> I'd imitate OCaml and use mutability ;)
<companion_cube> otherwise, it's also ok to hand-write a custom monad.
<companion_cube> I have done that several times for state+backtracking
<companion_cube> it'll be more efficient than stacking monads
Tuplanolla has joined #ocaml
olle has quit [Ping timeout: 265 seconds]
mbuf has quit [Quit: Leaving]
mikess has left #ocaml [#ocaml]
mikess has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mro has joined #ocaml
<d_bot> <Alistair> Is there a prettier extension for OCaml on vscode?
<companion_cube> you mean the colors?!
<d_bot> <Alistair> No, as in on save it will reformat your code e.g. tabs, line size, etc
<d_bot> <Anurag> The https://github.com/ocamllabs/vscode-ocaml-platform extension integrates with ocaml-lsp and can use ocamlformat to format your code.
<companion_cube> well install ocamlformat I guess
<d_bot> <Alistair> Thanks 🙂
dhil has quit [Ping timeout: 258 seconds]
dhil has joined #ocaml
<d_bot> <Alistair> Can you locally alias a module when opening e.g: `let open Foo as F in (bar 1, F.foo 2)`?
<companion_cube> `let module Foo = F in …`
<companion_cube> also cool for functors, first class modules ,etc.
<companion_cube> `let module Foo = Bar.Make() in …`
bartholin has quit [Quit: Leaving]
dhil has quit [Ping timeout: 265 seconds]
mro has quit [Remote host closed the connection]
<d_bot> <Alistair> Is it also possible to hide `val`s when `including`? I know ML used to have `:>`, but is there an equivalent in OCaml?
<companion_cube> you can cast to a module type
<companion_cube> include (Foo : BAR)
Haudegen has joined #ocaml
<d_bot> <Alistair> Thanks 🙂
dhil has joined #ocaml
mro has joined #ocaml
glassofethanol has quit [Quit: leaving]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
yoctocell has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
cedric has joined #ocaml
cedric has quit [Quit: Konversation terminated!]
<d_bot> <Alistair> How do I configure the ocaml-platform w/ ocamlformat?
<d_bot> <Alistair> I've installed it using `opam install ocamlformat`
cedric has joined #ocaml
<d_bot> <Anurag> Your project root should contain a file called `.ocamlformat`. You can set a formatter profile there ex:
<d_bot> <Anurag> ```
<d_bot> <Anurag> profile=conventional
<d_bot> <Anurag> ```
<d_bot> <Anurag>
<d_bot> <Anurag> After this as long as your lsp setup is working (make sure you have the ocaml language server installed), you should be able to format your code using vscode's built in commands for formatting files
<d_bot> <monk> we had someone in #beginners have difficulty with ocaml-platform the other day with vscode, they ended up using an entirely different plugin
<d_bot> <monk> if ocaml-platform + ocamlformat ends up working that's great, but here's the message:
<d_bot> <monk> > [1:39 PM] pekatour: Found a solution : the OCaml and Reason IDE extension allows autocompletion. Just needed to remove OCaml Platform and install the new extension!
<d_bot> <monk> no clue how that plays with the ocaml-lsp story
<d_bot> <Alistair> Thank you!
Stumpfenstiel has joined #ocaml
gravicappa has quit [Ping timeout: 250 seconds]
oriba has joined #ocaml
gzj has quit [Remote host closed the connection]
shawnw has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
mro has quit [Quit: Leaving...]
waleee has joined #ocaml
<d_bot> <Ulugbek> Wish we had #editorsupport channel to keep track of all questions and answers
vizard has quit [Ping timeout: 252 seconds]
vicfred has quit [Quit: Leaving]
Guest6205 has quit [Quit: Konversation terminated!]
Stumpfenstiel has quit [Ping timeout: 246 seconds]
cedric has quit [Quit: Konversation terminated!]
Guest3336 has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
ccx has quit [Ping timeout: 244 seconds]
ccx has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
waleee has quit [Ping timeout: 250 seconds]
Tuplanolla has quit [Quit: Leaving.]
haesbaert has quit [Quit: Lost terminal]