This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TypeSafeBuilder { | |
type F | |
type T | |
case class Cat(name: String, age: Int) | |
object CatBuilder { | |
def apply() = new CatBuilder[F, F](None, None) | |
implicit class BuildableCatBuilder(cb: CatBuilder[T, T]) { | |
def build(): Cat = cb.hiddenBuild() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================= | |
[ACatenable1 Tests] | |
[laws] | |
[lawful semicategory] | |
associativity | |
[free semicategory] | |
foldMap | |
lift | |
[tests] | |
compose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exception in thread "specs2-1" java.lang.StackOverflowError | |
at org.specs2.fp.Monad.ap(Monad.scala:19) | |
at org.specs2.fp.Monad.ap$(Monad.scala:18) | |
at org.specs2.control.eff.TimedFuture$$anon$1.ap(FutureEffect.scala:54) | |
at org.specs2.fp.Applicative.ap2(Applicative.scala:18) | |
at org.specs2.fp.Applicative.ap2$(Applicative.scala:17) | |
at org.specs2.control.eff.TimedFuture$$anon$1.ap2(FutureEffect.scala:54) | |
at org.specs2.fp.Applicative.apply2(Applicative.scala:33) | |
at org.specs2.fp.Applicative.apply2$(Applicative.scala:32) | |
at org.specs2.control.eff.TimedFuture$$anon$1.apply2(FutureEffect.scala:54) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.http4s | |
package server | |
package middleware | |
import cats.{~>, FlatMap, Functor} | |
import cats.data.{Kleisli, NonEmptyList} | |
import cats.effect.Effect | |
import cats.syntax.eq._ | |
import cats.syntax.functor._ | |
import cats.syntax.flatMap._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.http4s | |
package server | |
package middleware | |
import cats._ | |
import cats.data.{Kleisli, OptionT} | |
import fs2.Stream._ | |
import fs2._ | |
import java.nio.charset.StandardCharsets | |
import org.http4s.headers._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case object aa extends ISOLang | |
case object ab extends ISOLang | |
case object af extends ISOLang | |
case object am extends ISOLang | |
case object ar extends ISOLang | |
case object as extends ISOLang | |
case object ay extends ISOLang | |
case object az extends ISOLang | |
case object ba extends ISOLang | |
case object be extends ISOLang |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait FixT { | |
type T[_[_]] | |
def subst[F[_[_[_]]]](kt: F[T]): F[λ[k[_] => k[T[k]]]] | |
def unsubst[F[_[_[_]]]](kt: F[λ[k[_] => k[T[k]]]]): F[T] | |
} | |
package object matryoshka { | |
val FixI: FixT = new FixT { | |
type T[F[_]] = Fix[F] | |
def subst[F[_[_[_]]]](kt: F[T]): F[λ[k[_] => k[T[k]]]] = kt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait EitherTInstances { | |
implicit final def eitherMonadLayerControl[M[_], E] | |
(implicit M: Monad[M]): MonadLayerControl.Aux[EitherTC[M, E]#l, M, EitherC[E]#l] = { | |
new MonadLayerControl[EitherTC[M, E]#l, M] { | |
type State[A] = E Either A | |
val outerInstance: Monad[CurryT[EitherTCE[E]#l, M]#l] = | |
EitherT.catsDataMonadErrorForEitherT | |
val innerInstance: Monad[M] = M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scalaz | |
package data | |
import scalaz.meta.Ops | |
import scala.reflect.macros.whitebox.Context | |
import scala.language.experimental.macros | |
final class IdOps[A](self: A) extends Ops { | |
type O = IdOpsImpls.type | |
def squared: (A, A) = macro Ops.inline0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def inline0(c: whitebox.Context): c.Tree = { | |
import c.universe._ | |
val q"new ${cl: TypeTree}(..$p)" = c.prefix.tree | |
val moduleTySym = cl.tpe.member(TypeName("O")).typeSignature | |
val module = Ident(moduleTySym.termSymbol) | |
val pre = c.prefix | |
val appName = c.macroApplication.symbol.name.toString | |
q"$module.${TermName(appName)}(${p.head})" | |
} | |
NewerOlder