Skip to content

Commit

Permalink
fix compiler warnings in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bpholt committed Aug 29, 2024
1 parent 623e76d commit 934c815
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/examples/src/main/scala/Example1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package example
import cats.effect._
import cats.syntax.all._
import com.comcast.ip4s.Port
import fs2.io.net.Network
import natchez.http4s.implicits._
import org.http4s.ember.server.EmberServerBuilder
import org.http4s.server.Server
Expand All @@ -34,7 +35,7 @@ import natchez.http4s.NatchezMiddleware
object Http4sExample extends IOApp with Common {

// Our main app resource
def server[F[_]: Async]: Resource[F, Server] =
def server[F[_]: Async : Network]: Resource[F, Server] =
for {
ep <- entryPoint[F]
ap = ep.liftT(NatchezMiddleware.server(routes)).orNotFound // liftT discharges the Trace constraint
Expand Down
4 changes: 3 additions & 1 deletion modules/examples/src/main/scala/Example2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ import fs2.Stream
import org.http4s.ember.server.EmberServerBuilder
import org.http4s.implicits._
import org.http4s.server.middleware.Logger

import scala.io.StdIn
import com.comcast.ip4s.Host
import com.comcast.ip4s.Port
import fs2.io.net.Network

object Http4sExampleStreamed extends IOApp with Common {

def stream[F[_]: Async]: Stream[F, Nothing] = {
def stream[F[_]: Async : Network]: Stream[F, Nothing] = {
for {
ep <- Stream.resource(entryPoint[F])
finalRoutes = ep.liftT(NatchezMiddleware.server(routes))
Expand Down

0 comments on commit 934c815

Please sign in to comment.