Skip to content

Commit

Permalink
use private[this]
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed May 22, 2016
1 parent 9bf18b3 commit c3e3b2c
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion concurrent/src/main/scala/scalaz/concurrent/Actor.scala
Expand Up @@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicReference
*/
final case class Actor[A](handler: A => Unit, onError: Throwable => Unit = ActorUtils.rethrowError)
(implicit val strategy: Strategy) {
private val head = new AtomicReference[Node[A]]
private[this] val head = new AtomicReference[Node[A]]

val toEffect: Run[A] = Run[A](a => this ! a)

Expand Down
2 changes: 1 addition & 1 deletion concurrent/src/main/scala/scalaz/concurrent/Future.scala
Expand Up @@ -348,7 +348,7 @@ object Future {
}
}

private val finishedCallback: Any => Trampoline[Unit] =
private[this] val finishedCallback: Any => Trampoline[Unit] =
_ => sys.error("impossible, since there can only be one runner of chooseAny")

// implementation runs all threads, dumping to a shared queue
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/scalaz/ApplicativePlus.scala
Expand Up @@ -22,7 +22,7 @@ trait ApplicativePlus[F[_]] extends Applicative[F] with PlusEmpty[F] { self =>
implicit def G = G0
}

private class Mutual[A](a: F[A]) {
private[this] class Mutual[A](a: F[A]) {
lazy val y: Free.Trampoline[F[List[A]]] = z map (plus(_, point(Nil)))
lazy val z: Free.Trampoline[F[List[A]]] = y map (apply2(a, _)(_ :: _))
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/scalaz/CaseInsensitive.scala
Expand Up @@ -11,7 +11,7 @@ sealed abstract class CaseInsensitive[A] {
case _ => false
}

private val hash = Need(foldedCase.hashCode)
private[this] val hash = Need(foldedCase.hashCode)

final override def hashCode: Int = hash.value
}
Expand All @@ -21,7 +21,7 @@ object CaseInsensitive extends CaseInsensitiveInstances {

private[scalaz] def mk[A](a: A, fc: => A): CaseInsensitive[A] = new CaseInsensitive[A] {
val original = a
val fcCache = Need(fc)
private[this] val fcCache = Need(fc)
def foldedCase = fcCache.value
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/scalaz/FingerTree.scala
Expand Up @@ -1014,7 +1014,7 @@ object FingerTree extends FingerTreeInstances {
(implicit ms: Reducer[A, V]): FingerTree[V, A] =
new FingerTree[V, A] {
implicit val nMeasure = nodeMeasure[A, V]
val mz = Need(m)
private[this] val mz = Need(m)
def fold[B](b: V => B, f: (V, A) => B, d: (V, Finger[V, A], => FingerTree[V, Node[V, A]], Finger[V, A]) => B): B =
d(v, pr, mz.value, sf)
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/scala/scalaz/Kan.scala
Expand Up @@ -82,7 +82,7 @@ trait Lan[G[_], H[_], A] { lan =>

def map[B](g: A => B): Lan[G, H, B] = new Lan[G, H, B] {
type I = lan.I
val vc = Need(lan.v)
private[this] val vc = Need(lan.v)
def v = vc.value
def f(gi: G[I]) = g(lan f gi)
}
Expand Down Expand Up @@ -156,7 +156,7 @@ private trait LanApply[G[_], H[_]] extends Apply[Lan[G, H, ?]] with LanFunctor[G
def G: Functor[G]
def H: Apply[H]

private abstract class Internal[A] {
private[this] abstract class Internal[A] {
type T
def value: A
}
Expand All @@ -171,7 +171,7 @@ private trait LanApply[G[_], H[_]] extends Apply[Lan[G, H, ?]] with LanFunctor[G
type T = value.I
}
type I = (xfp.T, xp.T)
val vc = Need(H.tuple2(xfp.value.v, xp.value.v))
private[this] val vc = Need(H.tuple2(xfp.value.v, xp.value.v))
def v = vc.value
def f(gi: G[I]) = xfp.value.f(G.map(gi)(_._1))(xp.value.f(G.map(gi)(_._2)))
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/scalaz/Tree.scala
Expand Up @@ -195,8 +195,8 @@ object Tree extends TreeInstances {
object Node {
def apply[A](root: => A, forest: => Stream[Tree[A]]): Tree[A] = {
new Tree[A] {
val rootc = Need(root)
val forestc = Need(forest)
private[this] val rootc = Need(root)
private[this] val forestc = Need(forest)
def rootLabel = rootc.value
def subForest = forestc.value

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/scalaz/syntax/ApplicativeSyntax.scala
Expand Up @@ -26,7 +26,7 @@ trait ToApplicativeOps extends ToApplicativeOps0 with ToApplyOps {

////
implicit def ApplicativeIdV[A](v: => A) = new ApplicativeIdV[A] {
val nv = Need(v)
private[this] val nv = Need(v)
def self = nv.value
}

Expand All @@ -49,7 +49,7 @@ trait ApplicativeSyntax[F[_]] extends ApplySyntax[F] {
def η[A](a: => A)(implicit F: Applicative[F]): F[A] = F.point(a)

implicit def ApplicativeIdV[A](v: => A) = new ApplicativeIdV[A] {
val vc = Need(v)
private[this] val vc = Need(v)
def self = vc.value
}

Expand Down
2 changes: 1 addition & 1 deletion effect/src/main/scala/scalaz/effect/ST.scala
Expand Up @@ -67,7 +67,7 @@ sealed abstract class STArray[S, A] {
def z: A
implicit def tag: ClassTag[A]

val arr = Need(Array.fill(size)(z))
private[this] val arr = Need(Array.fill(size)(z))

private def value: Array[A] = arr.value

Expand Down
2 changes: 1 addition & 1 deletion iteratee/src/main/scala/scalaz/iteratee/EnumeratorT.scala
Expand Up @@ -187,7 +187,7 @@ trait EnumeratorTFunctions {

def enumIndexedSeq[E, F[_]: Monad](a : IndexedSeq[E], min: Int = 0, max: Option[Int] = None) : EnumeratorT[E, F] =
new EnumeratorT[E, F] {
private val limit = max.map(_ min (a.length)).getOrElse(a.length)
private[this] val limit = max.map(_ min (a.length)).getOrElse(a.length)
def apply[A] = {
def loop(pos : Int): StepT[E, F, A] => IterateeT[E, F, A] = {
s =>
Expand Down
Expand Up @@ -63,7 +63,7 @@ object ScalazProperties {

def minmaxsucc[A](implicit A: Enum[A]): Prop = A.enumLaw.minmaxsucc

private val smallInt = Gen.choose(-100, 100)
private[this] val smallInt = Gen.choose(-100, 100)

def succn[A](implicit A: Enum[A], arb: Arbitrary[A]) = forAll((x: A) => forAll(smallInt)(A.enumLaw.succn(x, _)))

Expand Down

0 comments on commit c3e3b2c

Please sign in to comment.