Skip to content

Instantly share code, notes, and snippets.

@alexeiras
alexeiras / typeclasses.scala
Created June 14, 2017 09:35
sealed abstract class deriving Eq
import cats.Eq
sealed abstract class Stone { val opponent: Stone }
case object O extends Stone { val opponent = X }
case object X extends Stone { val opponent = O }
implicit val catsEqForStone: Eq[Stone] = new StoneEq
class StoneEq extends Eq[Stone] {
def eqv(x: Stone, y: Stone): Boolean = { true }

Keybase proof

I hereby claim:

  • I am alexeiras on github.
  • I am alexeiras (https://keybase.io/alexeiras) on keybase.
  • I have a public key whose fingerprint is 0399 8455 B9FC A81F F7CD 2334 2087 DDB3 490F 368F

To claim this, I am signing this object:

@alexeiras
alexeiras / gist:09791c27d7b6786264f4
Created September 11, 2014 12:00
cabal install here failure
Resolving dependencies...
Configuring here-1.2.5...
Building here-1.2.5...
Failed to install here-1.2.5
Build log ( /Users/alex/.cabal/logs/here-1.2.5.log ):
Configuring here-1.2.5...
Building here-1.2.5...
Preprocessing library here-1.2.5...
[1 of 4] Compiling Data.String.Here.Internal ( src/Data/String/Here/Internal.hs, dist/build/Data/String/Here/Internal.o )
[2 of 4] Compiling Data.String.Here.Uninterpolated ( src/Data/String/Here/Uninterpolated.hs, dist/build/Data/String/Here/Uninterpolated.o )