Skip to content

Commit

Permalink
Merge pull request typelevel#2099 from satorg/smallopt-stream-monad-pure
Browse files Browse the repository at this point in the history
Slightly optimize Monad.pure for Stream
  • Loading branch information
mpilquist authored Oct 22, 2020
2 parents 06d97e9 + a3c3e24 commit 6aecba0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/fs2/Stream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4801,7 +4801,7 @@ object Stream extends StreamLowPriority {
private[fs2] trait StreamLowPriority {
implicit def monadInstance[F[_]]: Monad[Stream[F, *]] =
new Monad[Stream[F, *]] {
override def pure[A](x: A): Stream[F, A] = Stream(x)
override def pure[A](x: A): Stream[F, A] = Stream.emit(x)

override def flatMap[A, B](fa: Stream[F, A])(f: A => Stream[F, B]): Stream[F, B] =
fa.flatMap(f)
Expand Down

0 comments on commit 6aecba0

Please sign in to comment.