diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-10-29 21:22:03 -0700 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-10-29 21:22:03 -0700 |
commit | 405fa45fb0f2fe2a5d7d8f0f7ebd8f112fc7cd70 (patch) | |
tree | 2ff021ac69d86c7819378ba2510ab7ed2b9b063a /src/main/scala | |
parent | f32fca9c5858c487a83bf461d5b2ecc772025a4a (diff) | |
download | mill-405fa45fb0f2fe2a5d7d8f0f7ebd8f112fc7cd70.tar.gz mill-405fa45fb0f2fe2a5d7d8f0f7ebd8f112fc7cd70.tar.bz2 mill-405fa45fb0f2fe2a5d7d8f0f7ebd8f112fc7cd70.zip |
Got Zinc working on the test bench, compiling forge's own project
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/forge/Implicits.scala | 71 | ||||
-rw-r--r-- | src/main/scala/forge/Target.scala | 4 |
2 files changed, 0 insertions, 75 deletions
diff --git a/src/main/scala/forge/Implicits.scala b/src/main/scala/forge/Implicits.scala deleted file mode 100644 index 3295ce38..00000000 --- a/src/main/scala/forge/Implicits.scala +++ /dev/null @@ -1,71 +0,0 @@ -package forge - - -import scala.collection.mutable - -/** - * Container for all the type-level logic around appending things - * to tuples or flattening `Seq[Unit]`s into `Unit`s. - * - * Some of these implicits make liberal use of mutable state, so as - * to minimize allocations while parsing. - */ -object Implicits { - trait Sequencer[-T, V, R]{ - def apply(t: T, v: V): R - } - object Sequencer extends LowPriSequencer{ - def apply[T, V, R](f: (T, V) => R) = new Sequencer[T, V, R]{ - def apply(t: T, v: V): R = f(t, v) - } - implicit def SingleSequencer[T]: Sequencer[Unit, T, T] = Sequencer( (_, t) => t ) - } - trait LowPriSequencer extends LowerPriSequencer{ - implicit def UnitSequencer[T]: Sequencer[T, Unit, T] = Sequencer( (t, _) => t ) - } - trait LowerPriSequencer extends SequencerGen[Sequencer]{ - protected[this] def Sequencer0[A, B, C](f: (A, B) => C) = Sequencer(f) - } - trait Repeater[-T, R]{ - type Acc - def initial: Acc - def accumulate(t: T, acc: Acc): Unit - def result(acc: Acc): R - } - object Repeater extends LowPriRepeater{ - implicit object UnitRepeater extends Repeater[Unit, Unit]{ - type Acc = Unit - def initial = () - def accumulate(t: Unit, acc: Unit) = acc - def result(acc: Unit) = () - } - } - trait LowPriRepeater{ - implicit def GenericRepeaterImplicit[T] = GenericRepeater[T]() - case class GenericRepeater[T]() extends Repeater[T, Seq[T]]{ - type Acc = mutable.Buffer[T] - def initial = mutable.Buffer.empty[T] - def accumulate(t: T, acc: mutable.Buffer[T]) = acc += t - def result(acc: mutable.Buffer[T]) = acc - } - } - - trait Optioner[-T, R]{ - def none: R - def some(value: T): R - } - - object Optioner extends LowPriOptioner{ - implicit object UnitOptioner extends Optioner[Unit, Unit]{ - def none = () - def some(value: Unit) = () - } - } - trait LowPriOptioner{ - implicit def GenericOptionerImplicit[T] = GenericOptioner[T]() - case class GenericOptioner[T]() extends Optioner[T, Option[T]]{ - def none = None - def some(value: T) = Some(value) - } - } -}
\ No newline at end of file diff --git a/src/main/scala/forge/Target.scala b/src/main/scala/forge/Target.scala index 9dd3f8ab..c6908d1d 100644 --- a/src/main/scala/forge/Target.scala +++ b/src/main/scala/forge/Target.scala @@ -36,10 +36,6 @@ object Target{ def zip[V: Format](other: Target[V]) = { new Target.Zipped(this, other) } - def ~[V: Format, R: Format](other: Target[V]) - (implicit s: Implicits.Sequencer[T, V, R]): Target[R] = { - this.zip(other).map(s.apply _ tupled) - } } def test(inputs: Target[Int]*) = { new Test(inputs, pure = inputs.nonEmpty) |