companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #ocaml
cbarrett has quit [Read error: Connection reset by peer]
cbarrett has joined #ocaml
caasih has quit [Ping timeout: 252 seconds]
delyan_ has quit [Ping timeout: 248 seconds]
gdiazlo_caml has quit [Ping timeout: 252 seconds]
delyan_ has joined #ocaml
caasih has joined #ocaml
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 252 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 252 seconds]
gdiazlo_caml has joined #ocaml
chrisz has quit [Ping timeout: 255 seconds]
chrisz has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 248 seconds]
gdiazlo_caml has joined #ocaml
ns12 has quit [Quit: bye]
bhoot has joined #ocaml
ns12 has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 265 seconds]
gdiazlo_caml has joined #ocaml
ns12 has quit [Ping timeout: 248 seconds]
gdiazlo_caml has quit [Ping timeout: 260 seconds]
gdiazlo_caml has joined #ocaml
neuroevolutus has joined #ocaml
Ekho has quit [Quit: CORE ERROR, SYSTEM HALTED.]
<discocaml> <heyting> sadly this site seems to be a bit outdated, but thanks for the info, it's a good starting point
Ekho has joined #ocaml
YuGiOhJCJ has joined #ocaml
euphores has quit [Quit: Leaving.]
euphores has joined #ocaml
neuroevolutus has quit [Quit: Client closed]
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 252 seconds]
bhoot has quit [Ping timeout: 252 seconds]
gdiazlo_caml has joined #ocaml
toastal has joined #ocaml
dawids has joined #ocaml
dawids has quit [Client Quit]
gdiazlo_caml has quit [Remote host closed the connection]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 255 seconds]
bartholin has joined #ocaml
toastal has quit [Ping timeout: 255 seconds]
gdiazlo_caml has joined #ocaml
toastal has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 246 seconds]
Guest83 has joined #ocaml
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 265 seconds]
<Guest83> Hello. I'm stuck at a conceptual roadblock and would ask for a primer.
<Guest83> In e.g. Elixir I could do Enum.shuffle(myList) |> Enum.sort, just as an example. But in OCaml this type of function always returns a Unit so it can't be piped. What's the idiomatic way to work with mutated arrays/lists in OCaml?
gdiazlo_caml has joined #ocaml
<discocaml> <._null._> Lists aren't mutable, so you would pipe them. As for arrays, the way you would do in other imperative languages, so something like `Enum.shuffle arr; Enum.sort arr` (and `; arr`) to return it at the end
<Guest83> Wait, Array.sort modifies the data in place and returns a unit but List.sort returns a modified list? If so, is there a reason for these different implementations of sort?
<reynir> One is a mutable data structure and the other is an immutable data structure
<Guest83> That I understand. I'm trying to grasp why not both are one or the other.
Guest83 has quit [Ping timeout: 256 seconds]
terrorjack4 has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack4 has joined #ocaml
toastal has left #ocaml [Disconnected: Hibernating too long]
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
bhoot has joined #ocaml
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
<discocaml> <ada2k> Guest83: a list is not always appropriate where an array is
<discocaml> <ada2k> immutable linked lists are a very nice data structure, but sometimes you need mutability and random access that doesn’t require iterating through N entries in the list
<discocaml> <ada2k> a lot of data structures have immutable and mutable versions that seemingly do the same thing e.g. hashtbl and map
toastal has joined #ocaml
Tuplanolla has joined #ocaml
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
<discocaml> <gooby_clown> Are shallow effect handlers costly? That is, creating a bunch of them. I'll do some code gen and it will be pretty much just nesting lots of handlers so I was wondering if this can blow up
gdiazlo_caml has quit [Ping timeout: 272 seconds]
Anarchos has joined #ocaml
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 276 seconds]
gdiazlo_caml has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
gdiazlo_caml has quit [Ping timeout: 260 seconds]
Anarchos has joined #ocaml
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 255 seconds]
bhoot has quit [Remote host closed the connection]
gdiazlo_caml has joined #ocaml
toastal has left #ocaml [Disconnected: Hibernating too long]
bhoot has joined #ocaml
patrick_ is now known as patrick
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
<discocaml> <._null._> I imagine this would be as costly as nestling closures
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
bhoot has quit [Ping timeout: 248 seconds]
Anarchos has quit [Ping timeout: 248 seconds]
bhoot has joined #ocaml
bhoot has quit [Remote host closed the connection]
deavmi has joined #ocaml
bhoot has joined #ocaml
bhoot has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
toastal has joined #ocaml
bhoot has joined #ocaml
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
<discocaml> <yawaramin> the point of the array data structure in OCaml is to allow mutability for efficiency reasons. array sorting returning a new array would defeat the point
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
Serpent7776 has joined #ocaml
_whitelogger has quit [Ping timeout: 252 seconds]
_whitelogger has joined #ocaml
gdiazlo_caml has joined #ocaml
bhoot has quit [Remote host closed the connection]
bartholin has quit [Ping timeout: 248 seconds]
gdiazlo_caml has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
gdiazlo_caml has joined #ocaml
neuroevolutus has joined #ocaml
toastal has left #ocaml [Disconnected: Hibernating too long]
gdiazlo_caml has quit [Ping timeout: 260 seconds]
gdiazlo_caml has joined #ocaml
neuroevolutus has quit [Quit: Client closed]
euphores has quit [Quit: Leaving.]
euphores has joined #ocaml
neuroevolutus has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
bartholin has quit [Quit: Leaving]
Anarchos has quit [Read error: Connection reset by peer]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
Anarchos has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 255 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 265 seconds]
gdiazlo_caml has joined #ocaml
neuroevolutus has quit [Ping timeout: 256 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Serpent7776 has quit [Ping timeout: 255 seconds]
neuroevolutus has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
neuroevolutus has quit [Ping timeout: 256 seconds]
masterbuilder has quit [Remote host closed the connection]
masterbuilder has joined #ocaml