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 Evidence extends App { | |
class Foo[A] | |
class Bar[A] | |
class Zed[A] | |
// FirstK will find the first available evidence for entries in a TListK | |
{ | |
implicit val zedForString: Zed[String] = new Zed[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
require 'formula' | |
class Thrift < Formula | |
homepage 'http://thrift.apache.org' | |
head 'http://svn.apache.org/repos/asf/thrift/trunk' | |
url 'https://archive.apache.org/dist/thrift/0.7.0/thrift-0.7.0.tar.gz' | |
depends_on 'boost' | |
def install |
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
use std::rc::Rc; | |
trait HKT<U> { | |
type C; // Current type | |
type T; // Type with C swapped with U | |
} | |
macro_rules! derive_hkt { | |
($t:ident) => { | |
impl<T, U> HKT<U> for $t<T> { |
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 iota._ | |
import iota.TList.:: | |
import iota.TList.Op | |
import iota.syntax.inject._ | |
def foldTo[B]: CopFoldTo[B] = new CopFoldTo[B] | |
class CopFoldTo[B] { | |
// library code to add to iota | |
def apply[L <: TList, LF <: TList](a: Cop[L])(fs: Prod[LF])( |
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 foldTo[B]: CopFoldTo[B] = new CopFoldTo[B] | |
class CopFoldTo[B] { | |
def apply[L <: TList, LF <: TList](a: Cop[L])(fs: Prod[LF])( | |
implicit ev: TList.Compute.Aux[Op.Map[? => B, L], LF] | |
): B = | |
fs.values(a.index).asInstanceOf[Any => B].apply(a.value) | |
} | |
object Finn |
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 shapeless.Generic | |
import shapeless.HList | |
import shapeless.ops.hlist.FilterNot | |
import java.util.UUID | |
// compare case classes but ignore UUID fields in the comparison | |
object ExampleApp { | |
final case class Foo( |
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
[debug] Getting org.scala-sbt:compiler-interface:0.13.15:component from component compiler for Scala 2.12.2-bin-typelevel-4 | |
[debug] Getting org.scala-sbt:compiler-interface:0.13.15:component from component compiler for Scala 2.12.2-bin-typelevel-4 | |
[debug] Running cached compiler 28e7910f, interfacing (CompilerInterface) with Scala compiler version 2.12.2-bin-typelevel-4 | |
[debug] Calling Scala compiler with arguments (CompilerInterface): | |
[debug] -deprecation | |
[debug] -encoding | |
[debug] utf-8 | |
[debug] -explaintypes | |
[debug] -feature | |
[debug] -language:existentials |
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
/* | |
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com> | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 iota_bench | |
import iota._ | |
import cats._ | |
import cats.arrow.FunctionK | |
import cats.data.{ State => _, _ } | |
import cats.free._ | |
import org.scalacheck._ |
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
abstract class LiteralValue[S] { | |
def value: S | |
} | |
object LiteralValue { | |
def apply[S](implicit ev: LiteralValue[S]): LiteralValue[S] = ev | |
implicit def makeLiteralValue[S <: Singleton]: LiteralValue[S] = | |
macro LiteralValueMacros.makeLiteralValue[S] | |
} |