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
name: scrape | |
version: 0.1.0.0 | |
-- synopsis: | |
-- description: | |
homepage: https://github.com/githubuser/scrape#readme | |
license: BSD3 | |
license-file: LICENSE | |
author: Author name here | |
maintainer: [email protected] | |
copyright: 2018 Author name here |
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 OverloadedStrings #-} | |
-- https://medium.com/urbint-engineering/haskell-lens-operator-onboarding-a235481e8fac | |
module Main where | |
import Control.Lens | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import qualified Data.HashMap.Strict as HM |
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 #-} | |
module Main where | |
import Control.Monad | |
import Control.Monad.Trans.Class | |
import Control.Monad.Trans.Free | |
import Data.Sequence | |
data ThreadF next = Fork next next | |
| Yield next |
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 TemplateHaskell #-} | |
module Main where | |
import Control.Applicative | |
import Control.Lens hiding (op) | |
import Control.Monad | |
import Control.Monad.State | |
import Data.Char | |
import System.IO | |
import System.Random |
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 RankNTypes #-} | |
module Main where | |
import Control.Monad.State | |
import System.Random | |
type GenAction m = forall a. (Random a) => m a | |
type GenActionR m = forall a. (Random a) => (a, a) -> m a | |
data Player = Player |
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
module Main where | |
import Data.Foldable (asum) | |
import Data.Maybe (fromMaybe) | |
toMaybe :: Bool -> a -> Maybe a | |
toMaybe False _ = Nothing | |
toMaybe _ value = Just value | |
fizzbuzz :: Integer -> String |
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 sandbox.load | |
import io.gatling.core.Predef._ | |
import io.gatling.core.scenario.Simulation | |
import io.gatling.http.Predef._ | |
import scala.concurrent.duration._ | |
class LoadTest extends Simulation { | |
val httpConf = http.baseURL("http://127.0.0.1:8000") | |
val json = scala.io.Source.fromFile("/path/to/request.json").mkString |
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.implicits._ | |
import cats.effect.IO | |
import doobie._ | |
import doobie.implicits._ | |
import fs2.Stream | |
object Main extends App { | |
case class RedisClient() | |
val xa = Transactor.fromDriverManager[IO]( |
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 shapeless._ | |
trait AllSingletons[A, C <: Coproduct] { | |
def values: List[A] | |
} | |
object AllSingletons { | |
implicit def cnilSingletons[A]: AllSingletons[A, CNil] = | |
new AllSingletons[A, CNil] { | |
def values = Nil |
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 Main extends App { | |
import cats.effect.IO | |
import fs2.{Stream, Scheduler} | |
import fs2.async.signalOf | |
import fs2.async.mutable.Signal | |
import scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
def stopAfter[A](f: FiniteDuration): Stream[IO, A] => Stream[IO, A] = in => { | |
def close(s: Signal[IO, Boolean]): Stream[IO, Unit] = |
NewerOlder