Skip to content

Instantly share code, notes, and snippets.

View stephenjudkins's full-sized avatar

Stephen Judkins stephenjudkins

View GitHub Profile
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]
<stephenjudkins> luft: SBT can do anything, it's turing-complete
<stephenjudkins> there are examples of SBT tasks that generate scala source code
<dobblego> sbt is turing-complete? what does this mean?
<mapreduce> It can use an infinite amount of tape.
<stephenjudkins> luft: see https://github.com/twitter/sbt-scrooge
<dobblego> what does it mean specifically for sbt to be turing-complete?
<stephenjudkins> dobblego: use your imagination, and don't pick fights
<dobblego> jesus christ you are sook
<dobblego> it's a fucking question
<dobblego> can you tell me what it means please?
trait Imp[T] {}
object Imp {
implicit val i = new Imp[Int] {}
}
import Imp._
trait F {
type T
object Sort extends App {
//val toCells = (_: String).trim.split(" +")
//val input = io.Source.stdin.getLines.toList.map(toCells).foreach{line => }
val input = List("car", "truck", "8", "4", "bus", "6", "1")
val (matches, mismatches) = input.partition(_.matches("""\d+"""))
}