<commit_before>package base

import com.olegych.scastie.PastesActor.Paste
import java.util.concurrent.atomic.AtomicLong
import com.olegych.scastie.PastesActor

/**
  */
object TemplatePastes {
  private val pasteIds = new AtomicLong(1L) {
    def next = incrementAndGet()
  }

  val default = nextPaste( """
/***
scalaVersion := "2.10.3"

*/
object Main extends App {
}
                           """)

  val templates = {
    List(
      "typelevel" -> nextPaste( """
/***
scalaVersion := "2.10.3"

libraryDependencies ++= Seq("org.scalaz" %% "scalaz-core" % "7.0.6",
                            "org.typelevel" %% "shapeless-spire" % "0.1.2",
                            "org.typelevel" %% "shapeless-scalaz" % "0.1.2"
                            )
*/
object Main extends App {
  import scalaz._, Scalaz._
  println(List(some(1), none).suml)

  import shapeless._
  object combine extends Poly2 {
    implicit def caseCharString = at[Char, String]((c, s) => s.indexOf(c))
    implicit def caseIntBoolean = at[Int, Boolean]((i, b) => if ((i >= 0) == b) "pass" else "fail")
  }
  val l1 = "foo" :: true :: HNil
  val f1 = l1.foldLeft('o')(combine)
  println(f1)

  import spire.math._ // provides functions, types, and type classes
  import spire.implicits._ // provides infix operators, instances and conversions
  import spire.random._
  val rng = Cmwc5()
  implicit val nextmap = Dist.map[Int, Complex[Double]](2, 5)
  val m = rng.next[Map[Int, Complex[Double]]]
  println(m)
}
                                """)
      ,
      "typesafe" -> nextPaste( """
/***
scalaVersion := "2.10.3"

libraryDependencies ++= Seq("com.typesafe.play" %% "play" % "2.2.2")
*/
import play.api._
import play.api.mvc._
object Main extends App {
  import play.api.data.Form
  import play.api.data.Forms._
  case class A(i: Int)
  val f = Form(mapping("i" -> number)(A.apply)(A.unapply))
  println(f.fill(A(1)).get)
}
                                """)
      ,
      "sbt 0.13" -> nextPaste( """
/***
sbtPlugin := true
*/
import sbt._
object Build extends Build {
  val p = project.settings(Keys.scalaVersion := Keys.name.value)
}
                          """)
      ,
      "scala 2.9" -> nextPaste( """<commit_msg>more commonly accepted imports in sbt template<commit_after>package base

import com.olegych.scastie.PastesActor.Paste
import java.util.concurrent.atomic.AtomicLong
import com.olegych.scastie.PastesActor

/**
  */
object TemplatePastes {
  private val pasteIds = new AtomicLong(1L) {
    def next = incrementAndGet()
  }

  val default = nextPaste( """
/***
scalaVersion := "2.10.3"

*/
object Main extends App {
}
                           """)

  val templates = {
    List(
      "typelevel" -> nextPaste( """
/***
scalaVersion := "2.10.3"

libraryDependencies ++= Seq("org.scalaz" %% "scalaz-core" % "7.0.6",
                            "org.typelevel" %% "shapeless-spire" % "0.1.2",
                            "org.typelevel" %% "shapeless-scalaz" % "0.1.2"
                            )
*/
object Main extends App {
  import scalaz._, Scalaz._
  println(List(some(1), none).suml)

  import shapeless._
  object combine extends Poly2 {
    implicit def caseCharString = at[Char, String]((c, s) => s.indexOf(c))
    implicit def caseIntBoolean = at[Int, Boolean]((i, b) => if ((i >= 0) == b) "pass" else "fail")
  }
  val l1 = "foo" :: true :: HNil
  val f1 = l1.foldLeft('o')(combine)
  println(f1)

  import spire.math._ // provides functions, types, and type classes
  import spire.implicits._ // provides infix operators, instances and conversions
  import spire.random._
  val rng = Cmwc5()
  implicit val nextmap = Dist.map[Int, Complex[Double]](2, 5)
  val m = rng.next[Map[Int, Complex[Double]]]
  println(m)
}
                                """)
      ,
      "typesafe" -> nextPaste( """
/***
scalaVersion := "2.10.3"

libraryDependencies ++= Seq("com.typesafe.play" %% "play" % "2.2.2")
*/
import play.api._
import play.api.mvc._
object Main extends App {
  import play.api.data.Form
  import play.api.data.Forms._
  case class A(i: Int)
  val f = Form(mapping("i" -> number)(A.apply)(A.unapply))
  println(f.fill(A(1)).get)
}
                                """)
      ,
      "sbt 0.13" -> nextPaste( """
/***
sbtPlugin := true
*/
import sbt._
import Keys._
object Build extends Build {
  val p = project.settings(Keys.scalaVersion := Keys.name.value)
}
                          """)
      ,
      "scala 2.9" -> nextPaste( """
{'fraction_non_alphanumeric': 0.1610873960907661, 'fraction_numerical': 0.018422826331161535, 'mean_word_length': 2.382978723404255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3282846', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1531, 'n_words': 342}