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.State | |
import cats.free.Free | |
import cats.free.Free.liftF | |
import cats.kernel.Monoid | |
import cats.~> | |
type Amount = Double | |
// ADT for bank operations | |
sealed trait BankOperation[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
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Sand where | |
import Data.Aeson |
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 { | |
AvoidLosingGenericType.run() | |
AvoidMatchingOnGenericTypeParams.run() | |
TypeableExample.run() | |
TypeTagExample.run() | |
} | |
class Funky[A, B](val foo: A, val bar: B) { | |
override def toString: String = s"Funky($foo, $bar)" | |
} |
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.logging.Logger | |
import scala.concurrent.ExecutionContext | |
import de.flapdoodle.embed.mongo.{Command, MongodStarter} | |
import de.flapdoodle.embed.mongo.config.{MongodConfigBuilder, Net, RuntimeConfigBuilder} | |
import de.flapdoodle.embed.mongo.distribution.Version | |
import de.flapdoodle.embed.process.config.IRuntimeConfig | |
import de.flapdoodle.embed.process.config.io.ProcessOutput | |
import de.flapdoodle.embed.process.runtime.Network |
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
DateTime.metaClass.next << { -> delegate.plusDays(1) } | |
Interval interval = ... | |
def start = interval.start | |
def finish = interval.end | |
for (day in start..finish) { | |
// ... | |
} |
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
# Recipe for play-2.1.1-RC2 | |
require 'formula' | |
class Play < Formula | |
homepage 'http://www.playframework.org/' | |
url 'http://downloads.typesafe.com/play/2.1.1-RC2/play-2.1.1-RC2.zip' | |
md5 'ef4b378dae9c6a8711f9f5395e626ca3' | |
version '2.1.1-RC2' | |