mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 22:50:18 +00:00
just delete asInstanceOf (#259)
This commit is contained in:
parent
3e7b11db10
commit
b0d76b9631
@ -34,7 +34,7 @@ class AbilitiesAlgebra[F[_], Alg[_]](implicit A: InjectK[AbilityOp[F, *], Alg])
|
||||
def beginScope(token: Token[F]): Free[Alg, Unit] =
|
||||
Free.liftInject[Alg](BeginScope[F](token))
|
||||
|
||||
def endScope(): Free[Alg, Boolean] =
|
||||
def endScope(): Free[Alg, Unit] =
|
||||
Free.liftInject[Alg](EndScope[F]())
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class AbilitiesInterpreter[F[_], X](implicit
|
||||
getState.map(_.abilities.get(name))
|
||||
|
||||
override def apply[A](fa: AbilityOp[F, A]): State[X, A] =
|
||||
(fa match {
|
||||
fa match {
|
||||
case bs: BeginScope[F] =>
|
||||
beginScope(AbilitiesState.Frame[F](bs.token))
|
||||
|
||||
@ -145,5 +145,5 @@ class AbilitiesInterpreter[F[_], X](implicit
|
||||
).as(true)
|
||||
}
|
||||
|
||||
}).asInstanceOf[State[X, A]]
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,4 @@ case class GetServiceId[F[_]](name: Ability[F]) extends AbilityOp[F, Either[Bool
|
||||
|
||||
case class BeginScope[F[_]](token: Token[F]) extends AbilityOp[F, Unit]
|
||||
|
||||
case class EndScope[F[_]]() extends AbilityOp[F, Boolean]
|
||||
case class EndScope[F[_]]() extends AbilityOp[F, Unit]
|
||||
|
@ -31,7 +31,7 @@ class NamesInterpreter[F[_], X](implicit lens: Lens[X, NamesState[F]], error: Re
|
||||
}
|
||||
|
||||
override def apply[A](fa: NameOp[F, A]): State[X, A] =
|
||||
(fa match {
|
||||
fa match {
|
||||
case rn: ReadName[F] =>
|
||||
OptionT(constantDefined(rn.name.value))
|
||||
.orElseF(readName(rn.name.value))
|
||||
@ -107,5 +107,5 @@ class NamesInterpreter[F[_], X](implicit lens: Lens[X, NamesState[F]], error: Re
|
||||
beginScope(NamesState.Frame(bs.token))
|
||||
case _: EndScope[F] =>
|
||||
endScope
|
||||
}).asInstanceOf[State[X, A]]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user