companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
hyphen has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 248 seconds]
rgrinberg has joined #ocaml
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
waleee has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zebrag has quit [Quit: Konversation terminated!]
<d_bot> <atlx> are my project's dependencies installed automatically when someone downloads my project?
<d_bot> <atlx> *obviously assuming they run opam install or whatever it is*
<d_bot> <atlx> so for example, I have in my `dune-project`:
<d_bot> <atlx> ```lisp
<d_bot> <atlx> (depends ocaml dune ounit2 llvm)
<d_bot> <atlx> ```
<d_bot> <atlx> Will those be automatically downloaded and installed for developers who download the project's source code from its repository?
<d_bot> <Ambika E.> No
<d_bot> <Ambika E.> They need to install them on their own
<d_bot> <Ambika E.> If the dune project has an opam file with dependencies listed they can use `opam install . --deps-only` iirc
<d_bot> <Ambika E.> Otherwise you can use esy
williewillus has quit [Quit: The Lounge - https://thelounge.chat]
williewillus9 has joined #ocaml
williewillus9 has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 248 seconds]
kaph has quit [Ping timeout: 240 seconds]
williewillus5 has joined #ocaml
williewillus5 is now known as williewillus
Anarchos has joined #ocaml
rgrinberg has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
mro has joined #ocaml
<d_bot> <atlx> Does ocaml have anything similar to scalas for comprehension
mro has quit [Remote host closed the connection]
<d_bot> <sim642> I think the closest you can get is by using custom binding operators: https://ocaml.org/manual/bindingops.html
mro has joined #ocaml
mro has quit [Client Quit]
Anarchos has joined #ocaml
bartholin has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<d_bot> <Bluddy> I think something could be made with a ppx. There just hasn't been demand for it.
olle has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<d_bot> <romachkuna> any suggestions on how i can go about implementing this?
<d_bot> <orbitz> You've got to consume a list or commands and a tree. So start writing a function that does that
<d_bot> <orbitz> It'll be a recursive function
<d_bot> <romachkuna> yes right , i was thinking to put the tree nodes into the list and start constructing the new one with the commands order
<d_bot> <romachkuna> the UP commands seems little tricky
hyphen has quit [Quit: leaving]
hyphen has joined #ocaml
Haudegen has joined #ocaml
hyphen has quit [Quit: leaving]
hyphen has joined #ocaml
hyphen has quit [Quit: leaving]
hyphen has joined #ocaml
hyphen has quit [Client Quit]
hyphen has joined #ocaml
hyphen has quit [Client Quit]
hyphen has joined #ocaml
hyphen has quit [Client Quit]
hyphen has joined #ocaml
hyphen has quit [Client Quit]
hyphen has joined #ocaml
conjunctive has quit [Ping timeout: 245 seconds]
azimut has quit [Remote host closed the connection]
conjunctive has joined #ocaml
azimut has joined #ocaml
gravicappa has joined #ocaml
bartholin has quit [Quit: Leaving]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
waleee has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
<Corbin> Do folks always rewrite folds to the correct direction in order to get optimized tail calls? How costly is it to reverse a list before folding it instead?
<d_bot> <nave01314> Well, if f is commutative, then it’s not very hard to rewrite
<d_bot> <nave01314> In general I would use fold_right bc it’s more efficient, unless I had a use case where fold order mattered and I needed left to right
<sleepydog> Corbin: I don't rewrite it if I know the list is small and rewriting it makes it harder to read
<sleepydog> the tail_modulo_cons annotation in 4.14 seems to give you the best of both worlds
<Corbin> Is folding to the left more efficient than reversing and folding to the right?
Guest52 has joined #ocaml
Guest52 has quit [Client Quit]
<sleepydog> i dunno that it's more efficient, folding to the right just has the problem of using stack space relative to the size of the input
<Corbin> Sure. I'm currently implementing a CAM with bytecode and stack layout similar to OCaml, and I'm trying to understand whether I would prefer to have two fold directions, or one fold and a list-reversal primitive.
mro has quit [Remote host closed the connection]
<d_bot> <nave01314> my understanding is that `fold_left` is tail-recursive but requires reversing the list at the end, whereas `fold_right` is not tail-recursive and doesn't require reversing
<d_bot> <nave01314> ^ after looking at the implementation https://github.com/ocaml/ocaml/blob/trunk/stdlib/list.ml#L118-L126 my understanding is not correct
hyphen has quit [Ping timeout: 246 seconds]
hyphen has joined #ocaml
<d_bot> <Alistair> `fold_left` is tail recursive, but no reversal is performed (this is performed by the caller if required) e.g. reversal isn't required for commutative operations, such as summing a list
mro has joined #ocaml
rgrinberg has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
hyphen has quit [Ping timeout: 250 seconds]
mro has quit [Remote host closed the connection]
hyphen has joined #ocaml
motherfsck has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Ping timeout: 248 seconds]
shawnw has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
vicfred has quit [Quit: Leaving]
mro has joined #ocaml
motherfsck has joined #ocaml
mro has quit [Client Quit]
bartholin has joined #ocaml
dextaa has joined #ocaml
hyphen has quit [Ping timeout: 246 seconds]
hyphen has joined #ocaml
hyphen has quit [Ping timeout: 256 seconds]
hyphen has joined #ocaml
bartholin has quit [Ping timeout: 246 seconds]
bartholin has joined #ocaml
gravicappa has quit [Ping timeout: 248 seconds]
vicfred has joined #ocaml
<d_bot> <Ambika E.> I want to execute GNU `diff` on a user-provided filename and retrieve the exit code; is there a safe(r) way to do this compared to Sys.command ?
hyphen has quit [Ping timeout: 250 seconds]
hyphen has joined #ocaml
dextaa has quit [Ping timeout: 256 seconds]
bartholin has quit [Ping timeout: 272 seconds]
hyphen has quit [Ping timeout: 256 seconds]
<d_bot> <romachkuna> is there any way to access parent node of given value? in binary tree
<d_bot> <Ambika E.> usually no
<d_bot> <Ambika E.> each node is its own independent binary tree with no knowledge of whether or not it's actually a subtree in a larger tree
hyphen has joined #ocaml
bartholin has joined #ocaml
hyphen has quit [Read error: Connection reset by peer]
bartholin has quit [Quit: Leaving]
<d_bot> <Alistair> You'll either need to pass the parent down as an argument, or add a reference back to the parent
m5zs7k has quit [Quit: m5zs7k]
<d_bot> <KW78> ? add a reference -> an action to be performed by the parent upon return of the function (eg Delete)
olle has quit [Ping timeout: 256 seconds]
zebrag has joined #ocaml
kaph has joined #ocaml
szkl has joined #ocaml