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
package com.company | |
import play.api.{Mode, Configuration, GlobalSettings} | |
import java.io.File | |
import com.typesafe.config.ConfigFactory | |
object Global extends GlobalSettings { | |
override def onLoadConfig(config: Configuration, path: File, classloader: ClassLoader, mode: Mode.Mode): Configuration = { | |
println(s"loading config path: $path") |
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.Collections; | |
import java.util.List; | |
import java.util.Optional; | |
import java.util.function.Consumer; | |
import java.util.function.Function; | |
import java.util.function.Predicate; | |
/** | |
* A right biased disjoint union in Java with useful functional combinators. | |
* |
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 cats.data.Xor, cats.syntax.xor._, cats.data.XorT | |
//Some type aliases for semantic purposes | |
type IndexedSymbols = Iterable[(FileObject, List[FqnSymbol])] | |
type IndexingError = (String, Throwable) | |
type ProcessResult[A] = XorT[Future, IndexingError, A] |
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 cats._ | |
import cats.data._ | |
import shapeless._ | |
import shapeless.ops.hlist.Selector | |
implicit class ReaderOps[A, B, L <: HList](f: Reader[A, B]) { | |
def liftD[AA](implicit ga: Generic.Aux[AA, L], sel: Selector[L, A]): Reader[AA, B] = | |
f.local[AA](aa => sel.apply(ga.to(aa))) |
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 DeriveFunctor #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE OverlappingInstances #-} | |
module Main where | |
import Control.Monad.Free |
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.concurrent.ExecutionContext.global | |
for { | |
a <- nonBlocking | |
b <- simpleDbLookups | |
c <- expensiveDbLookups | |
d <- dbWriteOperations | |
e <- expensiveCpuOperations | |
} yield result |
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.concurrent.ExecutionContext.global | |
val af = fetchUserInfoService(userId) | |
val bf = simpleDbLookups | |
val cf = expensiveDbLookups | |
val df = dbWriteOperations | |
val ef = expensiveCpuOperations | |
for { | |
a <- af |
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 cats.data.{Xor, XorT} | |
import monix.eval.Task | |
import cats.implicits._ | |
import scala.util.control.NonFatal | |
/** | |
* Biz Errors and Exceptions are two separate things. | |
* Biz errors are valid business cases that should not be modeled in the `Throwable` hierarchy. | |
* They are models. |
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
https://github.com/scala-exercises/exercises-circe/issues/1 | |
https://github.com/scala-exercises/exercises-stdlib/issues/4 | |
https://github.com/scala-exercises/exercises-scalacheck/issues/16 | |
https://github.com/scala-exercises/exercises-scalacheck/issues/8 | |
https://github.com/scala-exercises/exercises-circe/issues/5 | |
https://github.com/scala-exercises/exercises-circe/issues/4 | |
https://github.com/scala-exercises/exercises-circe/issues/1 | |
https://github.com/scala-exercises/scala-exercises/issues/452 |
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 arrow.Kind | |
import arrow.core.Option | |
import arrow.core.Try | |
import arrow.core.functor | |
import arrow.effects.IO | |
import arrow.effects.fix | |
import arrow.effects.functor | |
import arrow.typeclasses.Functor | |
/* algebras */ |