Skip to content

Commit

Permalink
Add flush to print functions in std.Console
Browse files Browse the repository at this point in the history
  • Loading branch information
zetashift committed Mar 15, 2023
1 parent b3b24ea commit 54f1cf2
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,18 @@ private[std] abstract class ConsoleCompanionCrossPlatform {

def print[A](a: A)(implicit S: Show[A] = Show.fromToString[A]): F[Unit] = {
val text = a.show
F.blocking(System.out.print(text))
F.blocking {
System.out.print(text)
System.out.flush()
}
}

def println[A](a: A)(implicit S: Show[A] = Show.fromToString[A]): F[Unit] = {
val text = a.show
F.blocking(System.out.println(text))
F.blocking {
System.out.println(text)
System.out.flush()
}
}

def error[A](a: A)(implicit S: Show[A] = Show.fromToString[A]): F[Unit] = {
Expand Down

0 comments on commit 54f1cf2

Please sign in to comment.