I have copied an example from http4s:
// Print received Text frames, and, on completion, notify the console
val sink: Sink[Task, WebSocketFrame] = Process.constant {
case Text(t) => Task.delay(println(t))
case f => Task.delay(println(s"Unknown type: $f"))
}.onComplete(Process.eval[Task, Nothing](Task{println("Terminated!")}).drain)
This yields a compilation error: "Expression of type Unit doesn't conform to expected type _A"
I just want to printline "Terminated!" when the sink gets terminated