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 scala.reflect.runtime.universe._ | |
type ¬[A] = A => Nothing | |
type ∨[T, U] = ¬[¬[T] with ¬[U]] | |
type ¬¬[A] = ¬[¬[A]] | |
type |∨|[T, U] = { type λ[X] = ¬¬[X] <:< (T ∨ U) } | |
val intpf: PartialFunction[Int, Int] = { case i: Int => i } | |
val strpf: PartialFunction[String, String] = { case str: String => str } |
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 $ivy.`com.chuusai::shapeless:2.3.3` | |
import shapeless._ | |
trait Fields[T] { | |
def fields: List[String] | |
override def toString: String = fields.mkString(", ") | |
} | |
object Fields extends LabelledProductTypeClassCompanion[Fields] { | |
def apply[T](fs: List[String]): Fields[T] = new Fields[T] { | |
override def fields: List[String] = fs |
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 $ivy.`org.typelevel::cats-core:1.4.0` | |
import $ivy.`org.typelevel::kittens:1.1.1` | |
import cats._ | |
import cats.data.{Validated, ValidatedNel} | |
//import cats.instances.list._ | |
import cats.sequence._ | |
import shapeless._ | |
import shapeless.labelled._ | |
import shapeless.record._ |
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 $ivy.`io.getquill::quill:2.6.0` | |
import io.getquill._ | |
val ctx = new SqlMirrorContext(MirrorSqlDialect, Literal) | |
import ctx._ | |
case class Entity(field1: String, field2: Int) | |
def getEntity(field1: Option[String], field2: Option[Int]) = { |
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 coalesce[T] = quote { column: Option[T] => default: T => | |
infix"coalesce($column, $default)".as[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
Please note that these warnings are just used to help the Homebrew maintainers | |
with debugging if you file an issue. If everything you use Homebrew for is | |
working fine: please don't worry or file an issue; just ignore this. Thanks! | |
Warning: Homebrew's sbin was not found in your PATH but you have installed | |
formulae that put executables in /usr/local/sbin. | |
Consider setting the PATH for example like so | |
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile | |
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
cat /usr/local/etc/sbtopts | |
# ------------------------------------------------ # | |
# The SBT Configuration file. # | |
# ------------------------------------------------ # | |
-J-Xmx6G |
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 org.scalactic.Prettifier | |
import reactivemongo.bson._ | |
implicit val bdocPrettifier = Prettifier({ | |
case doc: BSONDocument => BSONDocument.pretty(doc) | |
}) |
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 class TEnum[P[_], R, A](repr: P[R], ve: ValueEnum[R, A])(implicit val ev: A <:< ValueEnumEntry[R]) extends TType[P, A] | |
.. | |
def tEnum[I, E](repr: Schema[TSchema, I], ve: ValueEnum[I, E])(implicit ev: E <:< ValueEnumEntry[I]): Schema[TSchema, E] = | |
prim(HMutu(TEnum(repr, ve))) | |
.. | |
override val encoder: TSchema ~> Encoder = new (TSchema ~> Encoder) { |
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.free.Trampoline | |
import cats.instances.stream._ | |
import cats.instances.try_._ | |
import cats.syntax.nested._ | |
import cats.syntax.traverse._ | |
import reactivemongo.bson._ | |
import scala.util.{Failure, Success, Try} | |
implicit class BSONValueOps(private val bv: BSONValue) extends AnyVal { |