Skip to content

Instantly share code, notes, and snippets.

View DeamonDev's full-sized avatar
:octocat:
Working from home

Piotr Rudnicki DeamonDev

:octocat:
Working from home
  • play.pl
  • Warsaw
View GitHub Profile
package example
import fs2._
object TransformingStreams extends App {
def tkWhile[F[_], O](p: O => Boolean): Pipe[F, O, O] = {
def go(s: Stream[F, O]): Pull[F, O, Unit] =
s.pull.uncons.flatMap {
case Some((hd, tl)) =>
package example
import fs2._
object TransformingStreams extends App {
def tkWhile[F[_], O](p: O => Boolean): Pipe[F, O, O] = {
def go(s: Stream[F, O]): Pull[F, O, Unit] =
s.pull.uncons.flatMap {
case Some((hd, tl)) =>
@DeamonDev
DeamonDev / n-0.log
Last active October 21, 2025 07:22
Example maelstrom echo workload node logs
2025/10/08 09:57:58 Received {c0 n0 {"type":"init","node_id":"n0","node_ids":["n0"],"msg_id":1}}
2025/10/08 09:57:58 Node n0 initialized
2025/10/08 09:57:58 Sent {"src":"n0","dest":"c0","body":{"in_reply_to":1,"type":"init_ok"}}
2025/10/08 09:57:58 Received {c2 n0 {"echo":"Please echo 66","type":"echo","msg_id":1}}
2025/10/08 09:57:58 Sent {"src":"n0","dest":"c2","body":{"echo":"Please echo 66","in_reply_to":1,"msg_id":1,"type":"echo_ok"}}
2025/10/08 09:57:58 Received {c2 n0 {"echo":"Please echo 9","type":"echo","msg_id":2}}
2025/10/08 09:57:58 Sent {"src":"n0","dest":"c2","body":{"echo":"Please echo 9","in_reply_to":2,"msg_id":2,"type":"echo_ok"}}
2025/10/08 09:57:58 Received {c2 n0 {"echo":"Please echo 34","type":"echo","msg_id":3}}
2025/10/08 09:57:58 Sent {"src":"n0","dest":"c2","body":{"echo":"Please echo 34","in_reply_to":3,"msg_id":3,"type":"echo_ok"}}
2025/10/08 09:57:58 Received {c2 n0 {"echo":"Please echo 113","type":"echo","msg_id":4}}