malc_ has left #ocaml ["ERC (IRC client for Emacs 28.0.50)"]
ggole has joined #ocaml
Haudegen has joined #ocaml
osa1 has joined #ocaml
bartholin has quit [Quit: Leaving]
borne has joined #ocaml
mbuf has quit [Ping timeout: 256 seconds]
olle has joined #ocaml
vicfred has quit [Quit: Leaving]
<ldb>
how can I trace where an exception is raised?
<d_bot>
<IwanKaramazow> In the ocaml compiler `typing/path.ml`, there's the following type definition:
<d_bot>
<IwanKaramazow> ```
<d_bot>
<IwanKaramazow> type t =
<d_bot>
<IwanKaramazow> Pident of Ident.t
<d_bot>
<IwanKaramazow> | Pdot of t * string * int
<d_bot>
<IwanKaramazow> | Papply of t * t
<d_bot>
<IwanKaramazow> ```
<d_bot>
<IwanKaramazow> What does the `int` represent in the constructo `Pdot` ?
<d_bot>
<IwanKaramazow> In the ocaml compiler `typing/path.ml`, there's the following type definition:
<d_bot>
<IwanKaramazow> ```
<d_bot>
<IwanKaramazow> type t =
<d_bot>
<IwanKaramazow> Pident of Ident.t
<d_bot>
<IwanKaramazow> | Pdot of t * string * int
<d_bot>
<IwanKaramazow> | Papply of t * t
<d_bot>
<IwanKaramazow> ```
<d_bot>
<IwanKaramazow> What does the `int` represent in the constructor `Pdot` ? (edited)
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
<octachron>
ldb, you can enable backtrace with an environment variable, OCAMLRUNPARAM=b, or within the program with `Printexc.record_backtrace true`.
<ldb>
octachron: thank you
<d_bot>
<octachron> @IwanKaramazow : this field is only present in old versions of the compiler.
<d_bot>
<Et7f3> he use 4.06 for syntax
<d_bot>
<Et7f3> I think he use 4.06 for syntax (edited)
<d_bot>
<Et7f3> I think he use 4.06 for rescript-syntax (edited)
<d_bot>
<Et7f3> I think he use 4.06 for rescript-syntax
<d_bot>
<octachron> It was the (runtime?) position of the field.
<d_bot>
<IwanKaramazow> Thanks
Putonlalla has joined #ocaml
ldb has quit [Quit: Connection closed]
mbuf has joined #ocaml
Et7f3 has joined #ocaml
<Et7f3>
when I use freenode I see a banner with 4.10 release note: doesn't be 4.11.2 ? and is their enough space to mention that `<d_bot> <user>` are `user` across a discord-bridge ?
osa1 has quit [Ping timeout: 265 seconds]
<zozozo>
companion_cube : do you have the rights to update the topic here at least to update the topic for 4.11 ? (since you have a shiny '@') cf Et7f3 message above
osa1 has joined #ocaml
osa1 has quit [Ping timeout: 260 seconds]
Et7f3 has quit [Remote host closed the connection]
borne has quit [*.net *.split]
adi_________ has quit [*.net *.split]
ansiwen[m] has quit [*.net *.split]
Boarders has quit [*.net *.split]
stylewarning has quit [*.net *.split]
robmyers has quit [*.net *.split]
heredoc has quit [*.net *.split]
bitonic has quit [*.net *.split]
stephe has quit [*.net *.split]
lopex has quit [*.net *.split]
heredoc has joined #ocaml
borne has joined #ocaml
lopex has joined #ocaml
adi_________ has joined #ocaml
robmyers has joined #ocaml
Boarders has joined #ocaml
stylewarning has joined #ocaml
bitonic has joined #ocaml
mfp has joined #ocaml
Drup has quit [Ping timeout: 246 seconds]
ansiwen[m] has joined #ocaml
stephe has joined #ocaml
stephe has joined #ocaml
stephe has quit [Changing host]
jbrown has joined #ocaml
Drup has joined #ocaml
osa1 has joined #ocaml
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
raver has quit [Remote host closed the connection]
<sgnb`>
there is a 4.11.2?
<d_bot>
<Et7f3> I don't see it: someone mentioned this version number and I haven't checked
<octachron>
There is no 4.11.2 in this branch of the multiverse.
<d_bot>
<Et7f3> Multiverse ?
<octachron>
? in the MWI interpretation of quantum mechanics, the wave function is real, and the wave function collapse is a result of the state of macroscopic objects becoming entangled with each other creating the illusion of multiple branches of the universe that are no longer interacting with each other. There might be a 4.11.2 in one of those unreachable branches.
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
osa1 has quit [Ping timeout: 240 seconds]
<d_bot>
<Et7f3> ```OCaml
<d_bot>
<Et7f3> This pattern matches values of type
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
dckc has joined #ocaml
Haudegen has joined #ocaml
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
vicfred has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
borne has quit [Ping timeout: 260 seconds]
bartholin has joined #ocaml
borne has joined #ocaml
ransom has joined #ocaml
Tuplanolla has joined #ocaml
ransom has quit [Ping timeout: 240 seconds]
Haudegen has quit [Quit: Bin weg.]
olle has quit [Ping timeout: 240 seconds]
nullcone has joined #ocaml
ransom has joined #ocaml
osa1 has quit [Ping timeout: 265 seconds]
waleee-cl has joined #ocaml
borne has quit [Ping timeout: 260 seconds]
<d_bot>
<arctumn> so i was doing some weird shenenigans with a friend and he showed me this ```RUST
<d_bot>
<arctumn> let data = [1,2,3,4,5,6,7,8,9,10,11,12];
<d_bot>
<arctumn>
<d_bot>
<arctumn> let vec_res = data.array_chunks().map(|&[x,y,z]| x * (y + z)).collect::<Vec<u8>>();
<d_bot>
<arctumn>
<d_bot>
<arctumn> print!("Res: ");
<d_bot>
<arctumn> for res in &vec_res {
<d_bot>
<arctumn> print!("{} ", res)
<d_bot>
<arctumn> } ```
<d_bot>
<arctumn> (its in rust) and i was trying to implement the array_chunks() with that .map() in ocaml and i ended up with this solution
<d_bot>
<arctumn> ```OCAML
<d_bot>
<arctumn> let before = [1;2;3;4;5;6;7;8;9;10;11;12]
<d_bot>
<arctumn> let rec (++) f list newlist = match list with
<d_bot>
<arctumn> | a:🅱:c::tl -> (++) f tl ((f (a,b,c))::newlist)
<d_bot>
<arctumn> | _ -> newlist
<d_bot>
<arctumn>
<d_bot>
<arctumn> let () = (++) (fun (x,y,z) -> x*(y+z)) before [] |> List.rev |> List.iter (fun x -> Printf.printf "%d " x) |> print_newline
<d_bot>
<arctumn> ``` It produces the same output but my question is, given my (++) implementation is it possible to reduce it size (sintax) or i did ended up with the shortest solution?
<d_bot>
<arctumn> so i was doing some weird shenenigans with a friend and he showed me this ```RUST
<d_bot>
<arctumn> let data = [1,2,3,4,5,6,7,8,9,10,11,12];
<d_bot>
<arctumn>
<d_bot>
<arctumn> let vec_res = data.array_chunks().map(|&[x,y,z]| x * (y + z)).collect::<Vec<u8>>();
<d_bot>
<arctumn>
<d_bot>
<arctumn> print!("Res: ");
<d_bot>
<arctumn> for res in &vec_res {
<d_bot>
<arctumn> print!("{} ", res)
<d_bot>
<arctumn> } ```
<d_bot>
<arctumn> ```OCAML
<d_bot>
<arctumn> (its in rust) and i was trying to implement the array_chunks() with that .map() in ocaml and i ended up with this solution
<d_bot>
<arctumn> let before = [1;2;3;4;5;6;7;8;9;10;11;12]
<d_bot>
<arctumn> let rec (++) f list newlist = match list with
<d_bot>
<arctumn> | a:🅱:c::tl -> (++) f tl ((f (a,b,c))::newlist)
<d_bot>
<arctumn> | _ -> newlist
<d_bot>
<arctumn>
<d_bot>
<arctumn> let () = (++) (fun (x,y,z) -> x*(y+z)) before [] |> List.rev |> List.iter (fun x -> Printf.printf "%d " x) |> print_newline
<d_bot>
<arctumn> ```
<d_bot>
<arctumn> It produces the same output but my question is, given my (++) implementation is it possible to reduce it size (sintax) or i did ended up with the shortest solution? (edited)
<d_bot>
<arctumn> so i was doing some weird shenenigans with a friend and he showed me this ```
<d_bot>
<arctumn> rust
<d_bot>
<arctumn> let data = [1,2,3,4,5,6,7,8,9,10,11,12];
<companion_cube>
and that's when one wants to enforce using a paste
<d_bot>
<arctumn>
<d_bot>
<arctumn> let vec_res = data.array_chunks().map(|&[x,y,z]| x * (y + z)).collect::<Vec<u8>>();
<d_bot>
<arctumn>
<d_bot>
<arctumn> print!("Res: ");
<d_bot>
<arctumn> for res in &vec_res {
<d_bot>
<arctumn> print!("{} ", res)
<d_bot>
<arctumn> }
<d_bot>
<arctumn> (its in rust) and i was trying to implement the array_chunks() with that .map() in ocaml and i ended up with this solution
<d_bot>
<arctumn> OCAML
<d_bot>
<arctumn> let before = [1;2;3;4;5;6;7;8;9;10;11;12]
<d_bot>
<arctumn> let rec (++) f list newlist = match list with
<companion_cube>
arctumn: you're spamming IRC right now :s
<d_bot>
<arctumn> | a:🅱:c::tl -> (++) f tl ((f (a,b,c))::newlist)
<d_bot>
<arctumn> | _ -> newlist
<d_bot>
<arctumn>
<d_bot>
<arctumn> let () = (++) (fun (x,y,z) -> x*(y+z)) before [] |> List.rev |> List.iter (fun x -> Printf.printf "%d " x) |> print_newline
<d_bot>
<arctumn> ```
<d_bot>
<arctumn> It produces the same output but my question is, given my (++) implementation is it possible to reduce it size (sintax) or i did ended up with the shortest solution? (edited)
<d_bot>
<arctumn> i was kinda changing the same message
<companion_cube>
please use a paste website :p
<companion_cube>
inline code is super spammy :/
<d_bot>
<arctumn> ohmm going to change asap
<companion_cube>
I mean now it's too late :p
<d_bot>
<arctumn> F
<companion_cube>
it's weird to use `(++)` for a non binary operator btw
<companion_cube>
it defeats the purpose of it being infix
<d_bot>
<arctumn> it was supposed to be but i'm trying to reduce corners
<companion_cube>
heh
<companion_cube>
code golfing?
<d_bot>
<arctumn> kinda
<d_bot>
<arctumn> the issue initually was the default map not allowing to acess to future elements via their index, and the mapi having a similar issue requiring the create the (++) function, but then it was a problem that i'm using to much code, and the ocaml.List library is good but not the greatest ever so i resulted coming here trying to ask if it was possible to cut more corners
<companion_cube>
I mean, if you need this kind of specific access pattern, recursive functions are your friends
<companion_cube>
that the rust example compiles is pretty amazing tbh
<companion_cube>
(it probably wouldn't if you needed chunks of more than 16 elements though, afaik)
Haudegen has joined #ocaml
<d_bot>
<arctumn> what you mean by more than 16 elements?
<companion_cube>
well, `|&[x1,x2,…,x17]| …` for example
<d_bot>
<octachron> Why not use an array and `Array.( init (length a/3) (fun i -> f a.(3*i) a.(3*i + 1) a.(3*i+2)) )`
<companion_cube>
@arctumn: also, you can just use `{:?}` to display the whole vec ;)
<d_bot>
<arctumn> oh the rust code it's from my friend, mine is just the ocaml one; octachron i did not think of it thx!
<d_bot>
<Anurag> Now that this channel is linked to irc, its probably worth adding a pin about IRC etiquette so we don't make the irc user's experience worse 🙂
<companion_cube>
hu, it actually doesn't compile for me?!
<companion_cube>
@Anurag: agreed
<companion_cube>
ahh it's unstable rust
<d_bot>
<arctumn> array_chunks its going to standart its not yet
bartholin has quit [Quit: Leaving]
ransom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ransom has joined #ocaml
ransom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eureton has joined #ocaml
eureton has quit [Client Quit]
narimiran has joined #ocaml
ransom has joined #ocaml
ransom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<companion_cube>
maybe tutorials on ocamlverse? not sure
<d_bot>
<ducaale> Thanks, I didn't know about that one. Although https://fsharpforfunandprofit.com/ is more about things that could be done in ML, things like parsers, monads, railway oriented programming domain modeling, etc. I don't see why all of these and more couldn't be done in OCaml. If only there was something that could sell the language to more peopele...
<d_bot>
<ducaale> Thanks, I didn't know about that one. Although https://fsharpforfunandprofit.com/ is more about things that could be done in ML, things like parsers, monads, railway oriented programming domain modeling, etc. I don't see why all of these and more couldn't be done in OCaml. If only there was something that could sell the language to more people... (edited)
<d_bot>
<ducaale> Thanks, I didn't know about that one. Although https://fsharpforfunandprofit.com/ is more about things that could be done in ML, things like parsers, monads, railway oriented programming domain modeling, etc. I don't see why all of these and more couldn't be done in OCaml. If only there was a site for OCaml that could sell the language to more people... (edited)
<companion_cube>
(we should also ask people to stop editing their messages :s)
<companion_cube>
anyway, no one has money to pay people to write stuff like that for OCaml the way microsoft does
oriba has joined #ocaml
<d_bot>
<arctumn> f# is like the ocaml twin that won the lottery but forgot about all of his family
govg has joined #ocaml
borne has joined #ocaml
ggole has quit [Quit: Leaving]
_whitelogger has joined #ocaml
<d_bot>
<ducaale> Thanks, I didn't know about that one. Although https://fsharpforfunandprofit.com/ is more about things that could be done in ML, things like parsers, monads, railway oriented programming, domain modeling, etc. I don't see why all of these and more couldn't be done in OCaml. If only there was a site for OCaml that could sell the language to more people... (edited)
<d_bot>
<companion_cube> @Bluddy any chance we can disable edits in here? 🙃