uncomfy has quit [Remote host closed the connection]
mbuf has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
gareppa has joined #ocaml
pukkamustard has left #ocaml [#ocaml]
bartholin has quit [Quit: Leaving]
henrytill has quit [Ping timeout: 245 seconds]
henrytill has joined #ocaml
spip has joined #ocaml
Tuplanolla has joined #ocaml
waleee has joined #ocaml
<greenbagels>
hm; i asked a question a week-ish ago about having an Lwt-based chat bot that has to constantly ping a server with keepalives
<greenbagels>
and the proposed solution was to "Lwt.async a function that just calls itself in a loop, with a sleep in the middle"
<greenbagels>
hm nevermind let me think about my question more
<greenbagels>
hm nevermind let me think about my question more
<greenbagels>
oops
<companion_cube>
that's what ocabot does
<greenbagels>
right, i think that solution works, i think i just misunderstand how to use lwt effectively, heh
<greenbagels>
questions like "should all my printfs become Lwt_io.printfs? should all functions that return () somewhere within an Lwt_main.run call return () Lwt.t instead?" etc
<haesbaert>
(it's ok to print in a non co-operative way)
<haesbaert>
assuming stdout is a tty and not some pipe
<greenbagels>
I guess the case I'm thinking of where my second question arises is if I have a bunch of pattern matching clauses where some return unit and some return unit Lwt.t
<greenbagels>
And I suppose there's no harm in wrapping the expressions returning unit type with Lwt.return
<discocaml>
<darrenldl> indeed. and, well, there's not much alternative
azimut has quit [Ping timeout: 240 seconds]
waleee has quit [Ping timeout: 246 seconds]
waleee has joined #ocaml
Anarchos has joined #ocaml
terri37 has joined #ocaml
<discocaml>
<dexmax> Is there any way to match a list based on its length without just using the List.length?
<discocaml>
<dexmax> Because I also want to get the last element of the list without traversing the list twice
terri37 has quit [Quit: Client closed]
terri82 has joined #ocaml
terri82 has quit [Quit: Client closed]
<discocaml>
<octachron> You could implement a function that returns the last element and the current length. However, both operations are a sign that `list`s are ill-fitted for the problem at hand.
waleee has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
smko has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
Anarchos has quit [Ping timeout: 245 seconds]
sagax has joined #ocaml
TrillionEuroNote has quit [Ping timeout: 240 seconds]
TrillionEuroNote has joined #ocaml
azimut has joined #ocaml
end^ has quit [Server closed connection]
end^ has joined #ocaml
TrillionEuroNote has quit [Ping timeout: 240 seconds]
TrillionEuroNote has joined #ocaml
dhil has joined #ocaml
smko has quit [Ping timeout: 240 seconds]
TrillionEuroNote has quit [Ping timeout: 264 seconds]