I hereby claim:
- I am knutwalker on github.
- I am knutwalker (https://keybase.io/knutwalker) on keybase.
- I have a public key whose fingerprint is CFDD 5271 6B23 352B 4DC0 DFEA AC0C 9439 3B0A AA10
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
package example.statemachine | |
import scalaz.{State, Scalaz}, Scalaz._ | |
object FSM { | |
def apply[I, S](f: PartialFunction[(I, S), S]): FSM[I, S] = | |
new FSM((i, s) => f.applyOrElse((i, s), (_: (I, S)) => s)) | |
private def states[S, O](xs: List[State[S, O]]): State[S, List[O]] = | |
xs.sequence[({type λ[α]=State[S, α]})#λ, O] |
module Main where | |
import Data.Char | |
import Data.List | |
main :: IO () | |
main = print | |
. maximum . map product | |
. filter((==13) . length) . map (take 13) . tails | |
. map digitToInt |
import fj.P; | |
import fj.P2; | |
import rx.Observable; | |
import rx.Subscriber; | |
public final class SlidingWindow { | |
public static Observable<P2<Integer, Integer>> viaScan(final Observable<Integer> integers) { | |
// allocate new Integer outside of integer cache range, so that it can be compared using `==` | |
// noinspection UnnecessaryBoxing |
import rx.Observable; | |
import rx.Scheduler; | |
import rx.schedulers.Schedulers; | |
import rx.schedulers.TestScheduler; | |
import java.io.IOException; | |
import java.util.List; | |
import java.util.concurrent.TimeUnit; | |
public final class TimersTest { |
package oanda | |
import argonaut._, Argonaut._, Shapeless._ | |
import spray.json._, DefaultJsonProtocol._ | |
import scala.util.Try | |
object J { | |
sealed trait MyMessages |
Result for sbt ping-benchmark
of rx-redis.
Total time: 00:04:36
Driver | Mode | Ops/s | Error |
---|---|---|---|
finagle-redis | sync | 12,188.275 | 426.685 |
finagle-redis | async | 101,368.142 | 132,961.138 |
import shapeless._ | |
import shapeless.labelled._ | |
import shapeless.ops.record._ | |
import scala.annotation.implicitNotFound | |
@implicitNotFound("Cannot prove that ${A} has an 'id: Int' field.") | |
trait HasId[A] { | |
def apply(a: A): Int | |
} |
/** | |
* Demonstrates various possibilities to declare a val and the resulting bytecode. | |
* | |
* Main takeaways are: | |
* - `private[this]` does not generate a getter and genertes direct field access | |
* - compile time constants are `final val x = e` with an optional modifier (§4.1) | |
* - final must be given, even if enclosing class is already final (§ 5.2 - 'final') | |
* - no type annotation may be present | |
*/ | |
final class Main { |
Benchmark | Mode | Cnt | Score | Error | Units |
---|---|---|---|---|---|
StreamPressureBench.bench_01_transducers | avgt | 5 | 89.049 | ± 5.785 | ms/op |
StreamPressureBench.bench_01_transducers:·compiler.time.profiled | avgt | 5 | 59.000 | ms | |
StreamPressureBench.bench_01_transducers:·compiler.time.total | avgt | 5 | 938.000 | ms | |
StreamPressureBench.bench_01_transducers:·gc.alloc.rate | avgt | 5 | 3426.787 | ± 224.769 | MB/sec |
StreamPressureBench.bench_01_transducers:·gc.churn.PS_Eden_Space | avgt | 5 | 3422.665 | ± 523.829 | MB/sec |
StreamPressureBench.bench_01_transducers:·gc.churn.PS_Survivor_Space | avgt | 5 | 0.262 | ± 0.485 | MB/sec |
Stream |