This file contains 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
65138 Paul Phillips | |
25821 Martin Odersky | |
19246 Eugene Burmako | |
15572 Aleksandar Prokopec | |
10850 Miguel Garcia | |
9197 Jason Zaugg | |
7652 Stéphane Micheloud | |
6952 Iulian Dragos | |
5807 Adriaan Moors | |
3367 Den Shabalin |
This file contains 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
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE GADTs #-} | |
module Data.Process where | |
import Prelude hiding (zipWith) | |
import Control.Applicative | |
import Control.Monad | |
import Data.Foldable |
This file contains 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 scalaz.stream._ | |
import Process._ | |
import scalaz.concurrent.Task | |
import scala.concurrent.duration._ | |
// git bisect identifies the offending commit as | |
// https://github.com/scalaz/scalaz-stream/commit/721716ed7af0c126593e9ee227c0f36f21c5b7ed | |
object Test { |
This file contains 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 argonaut._, Argonaut._ | |
class Example(val s: String, val i: Int) | |
object Example { | |
implicit def ExampleEncodeJson: EncodeJson[Example] = | |
EncodeJson(example => Json( | |
"s" := example.s, | |
"i" := example.i)) |
This file contains 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 Trampolines { | |
def odd[A](as: List[A]): TailRec[Boolean] = | |
as match { | |
case Nil => Return(false) | |
case _ :: xs => Suspend(() => even(xs)) | |
} | |
def even[A](as: List[A]) = as match { | |
case Nil => Return(true) | |
case _ :: xs => Suspend(() => odd(xs)) |
This file contains 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 scalaz._ | |
import \/._ | |
import Free._ | |
import scalaz.syntax.monad._ | |
import java.util.concurrent.atomic.AtomicReference | |
import java.util.concurrent.CountDownLatch | |
object Experiment { | |
sealed trait OI[A] { | |
def map[B](f: A => B): OI[B] |
This file contains 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 ForScalaz { | |
type CoyonedaF[F[_]] = ({type A[α] = Coyoneda[F, α]}) | |
def FG_to_CFG[F[_], G[_] : Functor, A](t: F ~> G): (CoyonedaF[F]#A ~> G) = { | |
type CF[A] = Coyoneda[F, A] | |
type CG[A] = Coyoneda[G, A] | |
val m: (CF ~> CG) = FG_to_CFCG(t) | |
val n: (CG ~> G) = CF_to_F | |
val o: (CF ~> G) = n compose m |
This file contains 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 java.util.function.Function; | |
@FunctionalInterface | |
public interface F<A, B> extends Function<A, B>{ | |
public default B apply(A a){ | |
try{ | |
return f(a); | |
}catch(Throwable e){ | |
throw new RuntimeException(e); | |
} |
This file contains 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
scala> :paste | |
// Entering paste mode (ctrl-D to finish) | |
case class Address(street : String, city : String, postcode : String) | |
case class Person(name : String, age : Int, address : Address) | |
// Exiting paste mode, now interpreting. | |
defined class Address | |
defined class Person |
This file contains 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.language.higherKinds | |
import scala.math.{pow} | |
import scalaz._ | |
import Scalaz._ | |
import scalaz.effect._ | |
case class Point(_x : Double, _y : Double) | |
case class GameUnit(_health : Int, _position : Point) |
OlderNewer