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
Apache License | |
Version 2.0, January 2004 | |
http://www.apache.org/licenses/ | |
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
1. Definitions. | |
"License" shall mean the terms and conditions for use, reproduction, |
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
### Keybase proof | |
I hereby claim: | |
* I am sullivan- on github. | |
* I am johnsullivanmscs (https://keybase.io/johnsullivanmscs) on keybase. | |
* I have a public key whose fingerprint is 4B13 C0DD DF42 8389 BDAD 11D9 A36D 692F 7D01 8E5D | |
To claim this, I am signing this object: |
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 Run extends App { | |
import cats._ | |
import io.iteratee._ | |
import io.iteratee.internal._ | |
def e = Enumerator.enumVector[Eval, Int]((0 until 10).toVector) | |
def ge = e.grouped(3) | |
println("fold ge") | |
Iteratee.foreach[Eval,Vector[Int]](println).apply(ge).run.value |
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 crash { | |
class Bar[A] | |
def bar[A](barOpt: Option[Bar[_ >: A]]): Bar[A] = new Bar | |
def build[A](barOpt: Option[Bar[_ >: A]]): Bar[A] = | |
// fix the crash by inserting "[A]" on the following line | |
bar(barOpt) |
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 longevity.persistence | |
import longevity.subdomain.PRef | |
import longevity.subdomain.Root | |
import longevity.subdomain.root.Query | |
import scala.concurrent.Future | |
/** a repository for aggregate roots of type `R` */ | |
trait Repo[R <: Root] { |
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 longevity.subdomain.Assoc | |
import longevity.subdomain.RootType | |
import longevity.subdomain.root.Key | |
import longevity.subdomain.root.KeyVal | |
object User extends RootType[User] { | |
object props { | |
val username = prop[String]("username") | |
} | |
val usernameKey = key(props.username) |
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 longevity.subdomain._ | |
case class User( | |
username: String, | |
firstName: String, | |
lastName: String) | |
extends Root | |
object User extends RootType[User] { | |
object props { |
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 User extends RootType[User] { | |
object props { | |
val username = prop[String]("username") | |
val firstName = prop[String]("firstName") | |
val lastName = prop[String]("lastName") | |
} | |
val usernameKey = key(props.username) | |
val fullnameKey = key(props.firstName, props.lastName) | |
} |
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 longevity.subdomain._ | |
case class User( | |
username: String, | |
firstName: String, | |
lastName: String) | |
extends Root | |
object User extends RootType[User] { | |
object props { |
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 longevity.integration.quickStart | |
import com.github.nscala_time.time.Imports._ | |
import org.scalatest.OptionValues._ | |
import org.scalatest._ | |
import org.scalatest.concurrent.ScalaFutures | |
import org.scalatest.concurrent.ScaledTimeSpans | |
import org.scalatest.time._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.Future |
NewerOlder