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
trait Fixed { | |
type U | |
type T = U => U | |
case class Rec(val f: Rec => T) { | |
def apply(x: Rec): T = f(x) | |
} | |
/** the recursively typed definition of fix |
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
/** | |
* | |
* t ::= x | |
* | \x. t | |
* | t t | |
*/ | |
object LambdaCalculus { | |
/** | |
* The type that represents |
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 models | |
import slick.lifted.Tag | |
trait Test { | |
val profile: slick.driver.JdbcProfile | |
import profile.simple._ | |
/** | |
* The wrapper class has an optional quantity field | |
* which itself has an optional size field |
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.virtualization.lms.common._ | |
import scala.reflect.SourceContext | |
import scala.virtualization.lms.internal.GenericCodegen | |
import lms._ | |
import java.io.PrintWriter | |
import java.io.StringWriter | |
import java.io.FileOutputStream | |
trait TestStruct extends Base with IfThenElse with Equal { |
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
/** | |
* For type-level calculations, it might help to think of a prolog implementation | |
* of `collapse`. We inline the use of `splitAt` and `reduceLeft`, for saving | |
* some lines | |
* | |
* // it is true that collapsing a list with no ints gives the list back as remainder | |
* collapse(ls, nil, op, nil, ls). | |
* | |
* // we can collapse a list for a given `Nat n`, if we can split the input | |
* // list, reduce the prefix (over the `op` operator), recursively collapse the |
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
{ | |
"statuses": [ | |
{ | |
"metadata": { | |
"result_type": "popular", | |
"iso_language_code": "en" | |
}, | |
"created_at": "Tue Sep 03 00:04:11 +0000 2013", | |
"id": 3.7468420748358e+17, | |
"id_str": "374684207483584512", |
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._ | |
object enumerate { | |
trait Gen[T] { | |
def gen: Stream[T] | |
} | |
object Gen { | |
def mkGen[T](st: Stream[T]): Gen[T] = new Gen[T] { |
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 Nats { | |
//we define natural numbers | |
//using peano numbers | |
//inspired from shapeless and https://gist.github.com/jto/2dc882c455b79378289f | |
trait Nat | |
case object Z extends Nat | |
case class Succ[N <: Nat](n: N) extends Nat |