Skip to content

Instantly share code, notes, and snippets.

@erdeszt
erdeszt / GDP.scala
Last active April 15, 2019 09:02
Ghosts of departed proofs in scala (https://github.com/matt-noonan/gdp-paper/releases)
trait Coercible[A, B] {
def coerce(a: A): B
}
def coerce[A, B](a: A)(implicit coerceAB: Coercible[A, B]): B = {
coerceAB.coerce(a)
}
trait Newtype[+T] {
val value: T
@erdeszt
erdeszt / IndexedResourceT.hs
Last active May 10, 2018 20:11
Indexed ResourceT monad (repl.it link: https://repl.it/repls/EsteemedDeficientArea)
{-# LANGUAGE KindSignatures
, PolyKinds
, DataKinds
, TypeFamilies
, TypeOperators
, GADTs
#-}
module IxResourceT where