Skip to content

Instantly share code, notes, and snippets.

@OlegYch
OlegYch / build.sbt
Last active July 18, 2023 14:50
get compile times by file/dir in sbt
val compileTimes = inputKey[Unit]("Get compilation time for each folder")
compileTimes / aggregate := false,
compileTimes := {
import complete.DefaultParsers._
// val ((depth, _), filter) = (NatBasic ~ " " ~ StringBasic).parsed
val (depth, filter) = spaceDelimited("depth filter").parsed match {
case Seq(depth, filter) => (depth.toInt, filter)
case _ => sys.error("expected depth and filter arguments, eg '2 /'")
}
val s = state.value
@pshirshov
pshirshov / light_type_tags.scala
Last active July 24, 2019 00:35
Runtime reflection free type tags PoC
package com.github.pshirshov.izumi.fundamentals.reflection
import com.github.pshirshov.izumi.fundamentals.reflection.LightTypeTag.{AbstractKind, AbstractReference, Boundaries, FullReference, Hole, Kind, NameReference, Variance}
import scala.language.experimental.macros
import scala.language.higherKinds
import scala.reflect.macros.blackbox
trait ALTT {
def t: LightTypeTag
import cats.data.Kleisli
import cats.effect.{ Concurrent, Sync }
import cats.effect.concurrent.MVar
import cats.implicits._
import cats.{ Applicative, Functor, Monad }
// Let's start with our dsl
// First we need to interact with a console
trait Console[F[_]] {
@rahulmutt
rahulmutt / Main.hs
Last active October 1, 2020 04:44
Fast coproducts for Haskell & Eta
#!/usr/bin/env stack
{- stack
--resolver lts-6.27
--install-ghc
runghc
--package containers
-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}