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
| package commons | |
| import scala.concurrent.ExecutionContext | |
| import akka.actor.ActorSystem | |
| case class Contexts(val actorSystem: ActorSystem) { | |
| import Contexts._ | |
| implicit val defaultCtx = DefaultExeCtx(play.api.libs.concurrent.Execution.defaultContext) | |
| implicit val ctrlsCtx = CtrlExeCtx(defaultCtx.underlying) |
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 Test { | |
| import scalaz._, Scalaz._ | |
| type FA[F[_], S, A] = FreeAp[λ[α => S => F[(S, α)]], A] | |
| type Precepte[F[_], S, A] = Free[({ type L[A] = FA[F, S, A] })#L, A] | |
| type UnmanagedState = List[String] | |
| trait PreBuilder[F[_]]{ | |
| type Pre[A] = Precepte[F, UnmanagedState, A] | |
| type St0[A] = UnmanagedState => F[(UnmanagedState, A)] | |
| type St[A] = FA[F, UnmanagedState, A] |
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
| /* | |
| def run = { | |
| import com.mfglabs.precepte._, default._, Macros.callee, corescalaz._ | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.concurrent.Future | |
| import default._ | |
| import scalaz.std.scalaFuture._ | |
| type Pre[A] = DefaultPre[Future, Unit, A] | |
| type ST = default.ST[Unit] |
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._ | |
| import Scalaz._ | |
| type Step0[F[_], S, A] = S => (S, F[A]) | |
| type Precepte[F[_], S, A] = Free[({ type L[A] = Step0[F, S, A] })#L, A] | |
| type UnmanagedState = List[String] | |
| type Pre[A] = Precepte[Id, UnmanagedState, A] | |
| object Pre { | |
| type St[A] = Step0[Id, UnmanagedState, A] |
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
| final class Compose1[T1, R] private (val fs: Vector[(Any => Any, Int)]) extends (T1 => R) { | |
| val MAX_DEPTH = 1000 | |
| private def append(gs: Vector[(Any => Any, Int)], fd: (Any => Any, Int)) = { | |
| val (fl, dl) = gs.last | |
| val (f, d) = fd | |
| if(d + dl > MAX_DEPTH) { | |
| fd +: gs | |
| } else { |
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
| case class Fix[F[_]](f: F[Fix[F]]) |
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
| package test | |
| trait ListF[+A, +S] | |
| trait Nil extends ListF[Nothing, Nothing] | |
| object Nil extends Nil | |
| case class Cons[A, +S](x: A, xs: S) extends ListF[A, S] | |
| case class Fix[F[_]](f: F[Fix[F]]) |
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
| package fix | |
| import cats._ | |
| object fix { | |
| trait ExprF[A] | |
| case class Const[A](value: Int) extends ExprF[A] | |
| case class Add[A](left: A, right: A) extends ExprF[A] | |
| case class Mul[A](left: A, right: A) extends ExprF[A] |
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
| case class Foo(i: Int) | |
| case class Bar(foo: Foo, g: String) | |
| val b = Bar(Foo(1), "toto") | |
| val h = ToHList(b) // List[shapeless.::[Int, shapeless.::[String, shapeless.HNil]]] = List(1 :: toto :: HNil) | |
| Ser.toCSV(h) // "1,toto" |
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
| > set every version := "0.3.2a" | |
| [info] Defining */*:version, core/*:version and 9 others. | |
| [info] The new values will be used by core/*:bintray::publishTo, core/*:bintrayRelease and 119 others. | |
| [info] Run `last` for details. | |
| [info] Reapplying settings... | |
| [info] Set current project to precepte-root (in build file:/Users/jto/Documents/MFG/precepte/) | |
| > publish | |
| [info] Packaging /Users/jto/Documents/MFG/precepte/precepte-core-cats/target/scala-2.11/precepte-core-cats_2.11-0.3.2a-sources.jar ... | |
| [info] Done packaging. | |
| [info] Packaging /Users/jto/Documents/MFG/precepte/precepte-influx/target/scala-2.11/precepte-influx_2.11-0.3.2a-sources.jar ... |