Skip to content

Instantly share code, notes, and snippets.

diff --git a/build.sbt b/build.sbt
index d239642..c97e604 100644
--- a/build.sbt
+++ b/build.sbt
@@ -6,10 +6,12 @@ crossScalaVersions in ThisBuild := Seq("2.11.12", "2.12.7")
scalacOptions in ThisBuild ++= Seq("-deprecation", "-feature", "-unchecked", "-language:higherKinds")
-val catsEffectVersion = "1.0.0"
+val catsEffectVersion = "1.4.0"
package net.tixxit.sniped.arithsolver
import scala.annotation.switch
object Solver {
final val Add = 0
final val Sub = 1
final val Mul = 2
final val Div = 3
package ambiguous
// A type class that can only be found if a corresponding type class `A` cannot be found.
final class Not[A]
object Not {
// Always available for any type.
implicit def not0[A]: Not[A] = new Not[A]
// If an implicit `A` also exists, then `Not` is ambiguous and compilation will fail.
implicit def not1[A](implicit a: A): Not[A] = new Not[A]
}
package net.tixxit.daggen
import cats.{Apply, Monad}
import cats.data.StateT
import cats.syntax.functor._
import shapeless.{::, HList, HNil}
import shapeless.ops.hlist._
import org.scalacheck.Arbitrary.arbitrary
package com.stripe.mapbench
import java.util.Arrays
import scala.collection.mutable.ArrayBuilder
class ArrayMap(val keys: Array[Int], val values: Array[Long]) {
def get(n: Int): Option[Long] =
scala.util.Try(apply(n)).toOption
def apply(n: Int): Long =
--langdef=scala
--langmap=scala:.scala
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|override)[ \t]*)*((private|protected)[ \t]*(\[[^\]]+\])?)?[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*class[ \t]+([a-zA-Z0-9_]+)/\8/c,classes/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|override)[ \t]*)*((private|protected)[ \t]*(\[[^\]]+\])?)?[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*case class[ \t]+([a-zA-Z0-9_]+)/\8/c,case classes/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|override)[ \t]*)*((private|protected)[ \t]*(\[[^\]]+\])?)?[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*trait[ \t]+([a-zA-Z0-9_]+)/\8/t,traits/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|override)[ \t]*)*((private|protected)[ \t]*(\[[^\]]+\])?)?[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*object[ \t]+([a-zA-Z0-9_]+)/\8/c,objects/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy|override)[ \t]*)*((private|protected)[ \t]*(\[[^\]]+\])?)?[ \t]*((abstr
sealed trait Step[K, V, T, I, O] {
def andThen[O2](that: Step[K, V, T, O2]): Step[K, V, T, O2] =
ComposedStep(this, that)
}
object Step {
type LeafSummerFunction[K, V, T, I, O] = (Map[Int, Tree[K, V, T]], Int, Int, I) => TraversableOnce[O]
type TrainingStep[K, V, T] = Step[K, V, T, Instance[K, V, T], Tree[K, V, T]]
@tixxit
tixxit / spire-survey.md
Last active September 17, 2015 13:40
Spire Learning Survey

Have you used Spire before?

  • Yes
  • No

What resources did you use to learn about Spire?

  • README and GUIDE on Spire's GitHub
  • Scaladoc
  • Tutorials and/or blog posts (which ones?)
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.2.2"
)
Welcome to Scala version 2.11.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_25).
Type in expressions to have them evaluated.
Type :help for more information.
scala> object Blah {
| def thing[A](a: Option[A]): Int = a match {
| case Some(x) => 23
| case None => 42
| }
| }