diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-04 03:28:14 -0700 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-04 03:28:14 -0700 |
commit | c5f3cb7fdcc610bd167460b75b22863f61d6fb4b (patch) | |
tree | d043f35276adc935dfb525835ac155651cd2bde9 /core/src | |
parent | 2071c7094d7f966136a5cf6dddcb4ee8fb81b688 (diff) | |
download | mill-c5f3cb7fdcc610bd167460b75b22863f61d6fb4b.tar.gz mill-c5f3cb7fdcc610bd167460b75b22863f61d6fb4b.tar.bz2 mill-c5f3cb7fdcc610bd167460b75b22863f61d6fb4b.zip |
Implement `ScalaDep` ADT to encapsulate handling on scala cross-version suffixes
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/scala/forge/package.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/src/main/scala/forge/package.scala b/core/src/main/scala/forge/package.scala index 8c24bde6..f183cddb 100644 --- a/core/src/main/scala/forge/package.scala +++ b/core/src/main/scala/forge/package.scala @@ -12,6 +12,8 @@ package object forge { def zipMap[A, B, C, R](a: T[A], b: T[B], c: T[C])(f: (A, B, C) => R) = zip(a, b, c).map(f.tupled) def zipMap[A, B, C, D, R](a: T[A], b: T[B], c: T[C], d: T[D])(f: (A, B, C, D) => R) = zip(a, b, c, d).map(f.tupled) def zipMap[A, B, C, D, E, R](a: T[A], b: T[B], c: T[C], d: T[D], e: T[E])(f: (A, B, C, D, E) => R) = zip(a, b, c, d, e).map(f.tupled) + def zipMap[A, B, C, D, E, F, R](a: T[A], b: T[B], c: T[C], d: T[D], e: T[E], f: T[F])(cb: (A, B, C, D, E, F) => R) = zip(a, b, c, d, e, f).map(cb.tupled) + def zipMap[A, B, C, D, E, F, G, R](a: T[A], b: T[B], c: T[C], d: T[D], e: T[E], f: T[F], g: T[G])(cb: (A, B, C, D, E, F, G) => R) = zip(a, b, c, d, e, f, g).map(cb.tupled) def zip() = new Target.Target0(()) def zip[A](a: T[A]) = a.map(Tuple1(_)) def zip[A, B](a: T[A], b: T[B]) = a.zip(b) @@ -27,6 +29,14 @@ package object forge { val inputs = Seq(a, b, c, d, e) def evaluate(args: Args) = (args[A](0), args[B](1), args[C](2), args[D](3), args[E](4)) } + def zip[A, B, C, D, E, F](a: T[A], b: T[B], c: T[C], d: T[D], e: T[E], f: T[F]) = new T[(A, B, C, D, E, F)]{ + val inputs = Seq(a, b, c, d, e, f) + def evaluate(args: Args) = (args[A](0), args[B](1), args[C](2), args[D](3), args[E](4), args[F](5)) + } + def zip[A, B, C, D, E, F, G](a: T[A], b: T[B], c: T[C], d: T[D], e: T[E], f: T[F], g: T[G]) = new T[(A, B, C, D, E, F, G)]{ + val inputs = Seq(a, b, c, d, e, f, g) + def evaluate(args: Args) = (args[A](0), args[B](1), args[C](2), args[D](3), args[E](4), args[F](5), args[G](6)) + } implicit object pathFormat extends Format[ammonite.ops.Path]{ def reads(json: JsValue) = json match{ case JsString(v) => JsSuccess(Path(v)) |