average has quit [Quit: Connection closed for inactivity]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
azimut has joined #ocaml
bartholin has joined #ocaml
bartholin has quit [Quit: Leaving]
Serpent7776 has joined #ocaml
azimut has quit [Ping timeout: 252 seconds]
mro has joined #ocaml
palainp has joined #ocaml
keyle has joined #ocaml
<discocaml>
<codebycc> Hi everyone I’m still experiencing troubles making on making contributions is anyone open to a zoom call or something to help me out
dnh has joined #ocaml
ec has quit [Ping timeout: 252 seconds]
ec has joined #ocaml
quernd809 has joined #ocaml
quernd80 has quit [Ping timeout: 264 seconds]
quernd809 is now known as quernd80
average has joined #ocaml
yziquel has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
waleee has joined #ocaml
bartholin has joined #ocaml
average has quit [Quit: Connection closed for inactivity]
infinity0 is now known as Guest8761
Guest8761 has quit [Killed (iridium.libera.chat (Nickname regained by services))]
infinity0 has joined #ocaml
omegatron has quit [Quit: Power is a curious thing. It can be contained, hidden, locked away, and yet it always breaks free.]
<discocaml>
<kumnadin_31037> hi everyone i am call kum nadin i will please like to work on this project in Ocaml impliment a dark mode for ocaml.org. sorry for coming inn late😆
<discocaml>
<barconstruction> I am trying to solve an exercise.
<discocaml>
<barconstruction> It is not for a class, it is for my own edification.
<discocaml>
<barconstruction> ```
<discocaml>
<barconstruction> type 'a tree = Node of ('a * (('a tree) list))
<discocaml>
<barconstruction> let map f = function
<discocaml>
<barconstruction> | Node (x, c) -> (Node (f x), List.map (map f) c)
<discocaml>
<barconstruction> ```
<discocaml>
<barconstruction> I hope it is clear what this code does.
<discocaml>
<barconstruction> It just applies the function `f` to every element in the tree.
<discocaml>
<barconstruction> `map : ('a -> 'b) -> 'a tree -> 'b tree`
<discocaml>
<Kali> you need `rec` after `let`, or `map` will be unbound in its body
<discocaml>
<barconstruction> oh yeah lol
<discocaml>
<barconstruction> ```
<discocaml>
<barconstruction> type 'a tree = Node of ('a * (('a tree) list))
<discocaml>
<barconstruction> let rec map f = function
<discocaml>
<barconstruction> | Node (x, c) -> (Node (f x), List.map (map f) c)
<discocaml>
<barconstruction> ```
<discocaml>
<barconstruction> anyway
<discocaml>
<Kali> just a note, edits here resend on the irc side— use #beginners for help
<discocaml>
<Kali> your parentheses are also wrong, it should be `Node ((f x), List.map (map f) c)`
<discocaml>
<barconstruction> The challenge is to implement this in a stack safe way for deep trees.
<discocaml>
<barconstruction> I have thought of two ways of doing this.
<discocaml>
<barconstruction> One involves keeping a fairly complicated accumulator using a list which contains the elements of the tree in reverse topological order, together with a map or similar data structure which keeps track of each node's parent.
<discocaml>
<barconstruction> This I am pretty sure I can do but it seems ugly.
<discocaml>
<barconstruction>
<discocaml>
<barconstruction> The second solution would be to use continuation passing style. This seems like it could be more elegant, but I can't figure out how to do it.
<discocaml>
<barconstruction> I would like a hint or suggestion as to how it is implemented.
<discocaml>
<barconstruction> yeah sorry discord doesn't have syntax highlighting or merlin or whatever.
<discocaml>
<Kali> it does, though: use \`\`\`ocaml rather than just \`\`\`
<discocaml>
<barconstruction> oh that's neat.
<discocaml>
<Kali> let's move to #beginners
dh` has joined #ocaml
mro has quit [Quit: Leaving]
mro has joined #ocaml
micro_ has quit [Ping timeout: 248 seconds]
mro has quit [Quit: Leaving]
micro has joined #ocaml
<discocaml>
<Et7f3 (@me on reply)> but you want to translate to what ? another human language for article ? or you want to migrate from php ? I know a tool for the opposite https://github.com/jordwalke/rehp
<h0rror>
5.1.0 has been out for some weeks, the topic should be updated :)
Serpent7776 has quit [Ping timeout: 255 seconds]
dnh_ has joined #ocaml
dnh has quit [Ping timeout: 264 seconds]
dnh_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<src>
I expected to run out of stack space with regards to the `take` function, but I don't when I run this in utop... are both functions somehow tail recurisve by chance?