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
| //So close but no cigar! | |
| sealed private[autolift] trait SideEffectFM[Obj, Function] extends DFunction2[Obj, Function] | |
| private[autolift] object SideEffectFM extends LowPrioritySideEffectFM{ | |
| def apply[Obj, Function](implicit se: SideEffectFM[Obj, Function]): Aux[Obj, Function, se.Out] = se | |
| implicit def recur[F[_], G, Function, Out0 >: Null](implicit bind: Bind[F], se: SideEffectFM.Aux[G, Function, Out0]): Aux[F[G], Function, se.Out] = | |
| new SideEffectFM[F[G], Function]{ | |
| type Out = Out0 |
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
| trait IsFuture[F]{ | |
| type T | |
| def apply(f: F): Future[T] | |
| } | |
| object IsFuture{ | |
| def apply[F](implicit isf: IsFuture[F]) = isf | |
| implicit def mk[A] = new IsFuture[Future[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
| trait Container[F[_], G[_,_], A, B, C]{ | |
| def get(idx: Int): F[A] | |
| def set(value: A, idx: Int): G[B, A] | |
| def replaceIf(f: A => Boolean, value: A): G[B, C] | |
| } | |
| class Many[A](list: List[A]) extends Container[Option,Either,A,Throwable,List[A]]{ | |
| //code here... | |
| } |
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
| trait Query[F[_],Key,Value]{ | |
| def get[T](key: Key)(implicit store: Store[Get, Value, T]): F[T] | |
| def set[T](key: Key)(value: Value)(implicit store: Store[Set, Value, T]): F[T] | |
| } |
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
| //historical chain of value. | |
| import java.concurrent.ConcurrentSkipListMap | |
| class History[Token, A, B](tk: => Token, prev: ConcurrentSkipListMap[Token, A], id: A => B){ | |
| def apply(f: A => A): (Token, B) ={ | |
| val token = tk | |
| (token, id(update(token, f))) | |
| } | |
| def map[C](f: B => C) = new History(prev, id andThen 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
| import export._ | |
| //contrived example | |
| trait LF[A] extends DepFn[A] | |
| @imports[LF] | |
| object LF{ | |
| //stuff | |
| } |
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 mkExportDefMacro(tcTpe: Type, exportTc: Type, nme: TermName): Tree = { | |
| val tcRef = mkAttributedRef(tcTpe) | |
| val kind = tcTpe.typeParams.map(_.asType.typeParams.length) | |
| val suffix = | |
| if(kind.exists(_ > 1) || kind.size > 22) | |
| c.abort(c.enclosingPosition, s"$tcTpe has an unsupported kind") | |
| else kind.mkString("") | |
| val (f, fd) = { | |
| val t = TypeName(c.freshName) |
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
| // auto-generated boilerplate | |
| package export | |
| import scala.language.experimental.macros | |
| import scala.reflect.macros.whitebox | |
| import macrocompat.bundle | |
| @bundle | |
| class ExportsImplExpr(val c: whitebox.Context) { | |
| import c.universe._ |
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
| 2.10.6 (not working) | |
| ____________ | |
| implicit <macro> def tpedefns$Triple$anonimplicit$0[$41$[$42$, $43$, $44$] >: tpedefns.this.Triple[$42$, $43$, $44$], $45$ >: _root_.scala.Nothing <: _root_.scala.Any, $46$ >: _root_.scala.Nothing <: _root_.scala.Any, $47$ >: _root_.scala.Nothing <: _root_.scala.Any]: export.this.Export5[$41$[$45$, $46$, $47$]] = _root_.export.ExportsImplExpr.exportsImpl000[tpedefns.this.Triple, $45$, $46$, $47$, export.this.Export5] | |
| 2.11.7 (working) | |
| ____________ | |
| implicit <macro> def tpedefns$Triple$anonimplicit$0[fresh$macro$753[fresh$macro$754, fresh$macro$755, fresh$macro$756] >: tpedefns.this.Triple[fresh$macro$754, fresh$macro$755, fresh$macro$756], fresh$macro$757, fresh$macro$758, fresh$macro$759]: export.this.Export5[fresh$macro$753[fresh$macro$757, fresh$macro$758, fresh$macro$759]] = _root_.export.ExportsImplExpr.exportsImpl000[tpedefns.this.Triple, fresh$macro$757, fresh$macro$758, fresh$macro$759, export.this.Export5] | |
| ++++++++ |
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
| 2.10.6 (not working) | |
| ______ | |
| object Triple extends LowerPriorityTriple { | |
| def <init>() = { | |
| super.<init>(); | |
| () | |
| }; | |
| object exports extends scala.AnyRef { | |
| def <init>() = { | |
| super.<init>(); |