Permalink
Browse files

bug fix for actor

  • Loading branch information...
1 parent 954b9c9 commit c26519920b4fc48b4a9fd3748f1048eb006c50ce @jdegoes committed Nov 10, 2011
Showing with 2 additions and 12 deletions.
  1. +1 −11 src/main/scala/blueeyes/actor/Actor.scala
  2. +1 −1 src/main/scala/blueeyes/actor/ActorMHelpers.scala
@@ -10,9 +10,7 @@ import scalaz.Scalaz._
* This trait is invariant because some actors may have complex dependencies
* between input / output types and some other polymorphic type.
*/
-trait ActorV[A, B] extends (A => ActorState[A, B]) with NewType[A => ActorState[A, B]] with Serializable { self =>
- final val value: A => ActorState[A, B] = (a: A) => receive(a)
-
+trait ActorV[A, B] extends Serializable { self =>
final def apply(a: A): ActorState[A, B] = receive(a)
final def ! (a: A): ActorState[A, B] = receive(a)
@@ -48,14 +46,6 @@ trait ActorV[A, B] extends (A => ActorState[A, B]) with NewType[A => ActorState[
final def !+! (as: Seq[A])(implicit semigroup: Semigroup[B]): ActorState[A, B] = !+! (as(0), as.tail: _*)
protected def receive(a: A): ActorState[A, B]
-
- override def equals(that: Any): Boolean = that match {
- case that: ActorV[_, _] => this.value == that.value
-
- case _ => false
- }
-
- override def hashCode: Int = value.hashCode
}
object Actor extends ActorModule
@@ -5,7 +5,7 @@ import scalaz.Scalaz._
trait ActorMHelpers {
def receive[M[_], A, B](fn: A => ActorMState[M, A, B]): ActorM[M, A, B] = new Actor[A, M[B]] {
- final def receive(a: A) = value(a)
+ final def receive(a: A) = fn(a)
}
def receiveSome[M[_], A, B, E >: MatchError](fn: PartialFunction[A, ActorMState[M, A, Validation[E, B]]])(pure: Pure[M]): ActorM[M, A, Validation[E, B]] = {

0 comments on commit c265199

Please sign in to comment.