This file contains hidden or 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._ | |
| import shapeless.HList._ | |
| import Report._ | |
| import Chronograph._ | |
| val sample = ReportLine(1,1,Micros) | |
| def toHList = Generic.product[ReportLine].to _ | |
| val sampleH = toHList(sample) |
This file contains hidden or 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 scalaz.Show._ | |
| import scalaz.Show | |
| implicit val reportline2show: Show[ReportLine] = shows { rl => | |
| val unitName = rl.timeUnit.name | |
| s"Rows: ${rl.rows}, totalTime: ${rl.time} $unitName, time per row: ${rl.timePerRow} $unitName" | |
| } |
This file contains hidden or 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 Chronograph { | |
| /** Chronon is the quantum of time, here in our silly computers it got be a Long */ | |
| type Chronon = Long | |
| sealed case class TimeUnit(chrononsInSecond: Chronon, name:String, getTime: => Chronon) | |
| val Nanos = new TimeUnit(1e9.toLong, "ns", System.nanoTime) | |
| val Micros = new TimeUnit(1e6.toLong, "μs", System.nanoTime*1000) | |
| val Millis = new TimeUnit(1e3.toLong, "ms", System.currentTimeMillis()) |
This file contains hidden or 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
| /** | |
| * Created by pedrofurla on 26/03/14. | |
| */ | |
| package slicks.docs | |
| import slicks.docs.dao.{Entity, IdentifiableTable, CrudComponent, Profile} | |
| case class User(id: Option[Long], first: String, last: String) extends Entity[Long] | |
| trait UserComponent extends CrudComponent { outer: Profile => |
This file contains hidden or 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
| @tailrec private def isEvenlyDivisible(i: Int, a: Int, b: Int): Boolean = { | |
| if (i > b) true | |
| else (a % i == 0) && isEvenlyDivisible(i+1, a, b) | |
| } |
This file contains hidden or 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
| typedef GLenum = unsigned long | |
| typdef GLboolean = boolean | |
| typdef GLbitfield = unsigned long | |
| typdef GLbyte = byte | |
| typdef GLshort = short | |
| typdef GLint = long | |
| typdef GLsizei = long | |
| typdef GLintptr = long long | |
| typdef GLsizeiptr = long long | |
| typdef GLubyte = octet |
This file contains hidden or 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
| isIdent :: String -> Ident -> Bool | |
| isIdent s (Ident id') = id' == s | |
| isIdentG :: forall a. Typeable a => String -> a -> Bool | |
| isIdentG s = False `mkQ` (isIdent s) | |
| {-| One level search of `Ident`s -} | |
| withId1 :: forall a. Data a => String -> a -> Bool | |
| withId1 s = or . (gmapQ (isIdentG s)) -- This saves me from matching against 7 different constructors |
This file contains hidden or 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
| {-# LANGUAGE ExistentialQuantification #-} | |
| module WebIdl.Ast where | |
| import WebIdl.Lex | |
| type Ident = String | |
| type ExtAttributes = String | |
| type Default = Maybe Literal |
This file contains hidden or 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
| comonad-4.0 (reinstall) changes: semigroups-0.12.2 -> 0.12.1 | |
| exceptions-0.3.3 (new package) | |
| newtype-0.2 (new package) | |
| constraints-0.3.4.2 (new package) | |
| parsers-0.10.3 (new package) | |
| scientific-0.2.0.1 (reinstall) changes: hashable-1.1.2.5 -> 1.2.1.0 | |
| aeson-0.7.0.1 (new version) | |
| semigroupoids-4.0 (reinstall) changes: semigroups-0.12.2 -> 0.12.1 | |
| bifunctors-4.1.1 (new version) | |
| pointed-4.0 (new version) |
This file contains hidden or 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
| ScalaJS.impls.example_WebAudio$AudioParam$class__$init$__Lexample_WebAudio$AudioParam__V = (function($this) { | |
| $this.value_$eq__Lscala_scalajs_js_Number__V(ScalaJS.modules.scala_Predef().$qmark$qmark$qmark__Lscala_Nothing()); | |
| $this.example$WebAudio$AudioParam$_setter_$defaultValue_$eq__Lscala_scalajs_js_Number__V(ScalaJS.modules.scala_Predef().$qmark$qmark$qmark__Lscala_Nothing()) | |
| }); | |
| ScalaJS.impls.example_WebAudio$GainNode$class__$init$__Lexample_WebAudio$GainNode__V = (function($this) { | |
| $this["example$WebAudio$GainNode$_setter_$gain"] = ScalaJS.modules.scala_Predef().$qmark$qmark$qmark__Lscala_Nothing() | |
| }); | |
| /** @constructor */ |