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 Test { | |
import cats._ | |
import cats.data._ | |
import cats.implicits._ | |
import org.atnos.eff._ | |
import org.atnos.eff.all._ | |
import org.atnos.eff.syntax.all._ | |
case class Address() |
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
import cats._, data._ | |
import org.atnos.eff._, all._ | |
import org.atnos.eff.syntax.all._ | |
object ComputationOrder { | |
//// With 3 effects, it fails when I use runNel at the beginning | |
type C3 = Fx.fx3[State[String,?],Choose,Validate[String,?]] |
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
// The following, models a HAL Resource based on HAL specification: | |
// http://stateless.co/hal_specification.html | |
// And provides Argonaut JSON encoders for that model | |
// (Argonaut is a purely functional Scala JSON library) | |
// http://argonaut.io/ | |
import shapeless._ | |
import shapeless.ops.hlist.{ToTraversable, Mapper} | |
import argonaut._, Argonaut._ | |
import scala.language.existentials | |
import scala.language.higherKinds |
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 Test extends App { | |
trait CanEqual[-A] { | |
def equals(a1: A, a2: A): Boolean | |
} | |
object CanEqual { | |
def apply[A](implicit ev: CanEqual[A]): CanEqual[A] = ev | |
def equals[A](f: (A, A) => Boolean): CanEqual[A] = new CanEqual[A] { | |
def equals(a1: A, a2: A): Boolean = f(a1, a2) | |
} |