Skip to content

Instantly share code, notes, and snippets.

View davidpeklak's full-sized avatar

David Peklak davidpeklak

  • Winterthur, Switzerland
View GitHub Profile
import java.util.concurrent.{TimeUnit, Executors}
import scala.annotation.tailrec
import scalaz.{\/-, -\/, \/}
import java.util.concurrent.atomic.AtomicReference
object TM {
case class Baseline[A](baseline: A)
case class Transaction[A](baseline: Baseline[A], update: A)
@davidpeklak
davidpeklak / EffectReturn.idr
Created April 13, 2015 19:30
'return' in idris effects
module Main
import Effects
import Effect.StdIO
FOO : Type -> EFFECT
FOO t = ?FOO
------------- This works -----------
import java.sql.{Connection, PreparedStatement}
object SqlInterpolation {
case class StatementPreparation(string: String, effect: PreparedStatement => Unit) {
override def toString: String = s"""StatementPreparation("$string", $effect)"""
}
implicit class ConnectionOps(val connection: Connection) extends AnyVal {
def prepareStatement(sp: StatementPreparation): PreparedStatement = {