trait Console[F[_]] {
def readLine: F[String]
def printLine(s: String): F[Unit]
}
// I know that all this function can do is call `readLine`.
// What's more, it can only do it exactly (usefully) once.
package example | |
import cats.effect.{ExitCode, IO, IOApp} | |
import org.http4s.HttpRoutes | |
import org.http4s.dsl.Http4sDsl | |
import org.http4s.server.blaze.BlazeServerBuilder | |
import org.http4s.implicits._ | |
import scala.concurrent.ExecutionContext |
{-# LANGUAGE GeneralisedNewtypeDeriving #-} | |
{-# LANGUAGE TypeApplications #-} | |
module Day2 | |
( main | |
) | |
where | |
import Control.Monad.State ( State | |
, MonadState |
{-# LANGUAGE DerivingVia #-} | |
{-# LANGUAGE GeneralisedNewtypeDeriving #-} | |
module Day1 | |
( moduleMasses | |
, partOne | |
, partTwo | |
) | |
where |
package newbeeper.performance | |
import cats.effect.concurrent.{MVar, Ref} | |
import cats.effect.syntax.concurrent._ | |
import cats.effect.{Concurrent, ConcurrentEffect, Sync} | |
import cats.syntax.flatMap._ | |
import cats.syntax.functor._ | |
import fs2.Stream | |
import org.scalacheck.Arbitrary |
package foo | |
import cats.effect.{IO, Resource, Sync} | |
import cats.effect.concurrent.Ref | |
import cats.implicits._ | |
import doobie.util.transactor.Transactor | |
/** | |
* The `Foo` domain model. | |
* |
trait Console[F[_]] {
def readLine: F[String]
def printLine(s: String): F[Unit]
}
// I know that all this function can do is call `readLine`.
// What's more, it can only do it exactly (usefully) once.
import cats.effect.{ExitCode, IO, IOApp, Resource} | |
import org.http4s.HttpRoutes | |
import org.http4s.client.Client | |
import org.http4s.client.blaze.BlazeClientBuilder | |
import org.http4s.dsl.Http4sDsl | |
import org.http4s.implicits._ | |
import cats.implicits._ | |
object Http4sClientTest extends IOApp { |
I hereby claim:
To claim this, I am signing this object:
module IntermediateHaskellExercises where | |
class Fluffy f where | |
furry :: (a -> b) -> f a -> f b | |
-- Exercise 1 | |
instance Fluffy [] where | |
furry :: (a -> b) -> [a] -> [b] | |
furry _ [] = [] | |
furry f (x:xs) = f x : furry f xs |
package com.tomwadeson.show | |
import com.tomwadeson.Show.Showable | |
import scala.language.implicitConversions | |
trait Show[A] { | |
def show(a: A): String | |
} |