Skip to content

Commit 169f0d7

Browse files
committed
Actually liftS will do in place of _liftS, consistent with
changes coming in 0.6.0.
1 parent d977d7c commit 169f0d7

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

HISTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ History
44
### 0.5.3 (unreleased)
55

66
* Workaround for Scala's type inference failing with `StateT.liftS` on functions.
7-
Instead of `f(_).liftS`, `f._liftS` is now available and is confirmed to work in `_runState`.
7+
Instead of `f(_).liftS`, `f.liftS` is now available and is confirmed to work in `_runState`.
88

99
### 0.5.2 ([commit log](https://github.com/japgolly/scalajs-react/compare/v0.5.1...v0.5.2))
1010

scalaz-7.0/src/main/scala/japgolly/scalajs/react/ScalazReact.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ object ScalazReact {
181181
}
182182

183183
implicit final class SzRExt__StateTOps[I, M[+_], S, A](val f: I => StateT[M, S, A]) extends AnyVal {
184-
@inline def _liftS(implicit M: Functor[M]): I => ReactST[M, S, A] = f(_).liftS
184+
@inline def liftS(implicit M: Functor[M]): I => ReactST[M, S, A] = f(_).liftS
185185
}
186186

187187
implicit final class SzRExt_ReactSTOps[M[+_], S, A](val s: ReactST[M,S,A]) extends AnyVal {
@@ -223,9 +223,9 @@ object ScalazReact {
223223
def runStateS[M[+_], A](st: => StateT[M, S, A])(implicit C: CC, M: M ~> IO, N: Functor[M]): IO[A] =
224224
runState(st.liftS)
225225

226-
@deprecated("Instead of _runStateS(f), use _runState(f._liftS). _runStateS will be removed in 0.7.0.", "0.5.2")
226+
@deprecated("Instead of _runStateS(f), use _runState(f.liftS). _runStateS will be removed in 0.7.0.", "0.5.2")
227227
def _runStateS[I, M[+_], A](f: I => StateT[M, S, A])(implicit C: CC, M: M ~> IO, N: Functor[M]): I => IO[A] =
228-
_runState(f._liftS)
228+
_runState(f.liftS)
229229

230230
def runStateF[M[+_], A](st: => ReactST[M, S, A])(implicit C: CC, M: M ~> IO, F: ChangeFilter[S]): IO[A] =
231231
run[M, A, A](st, (s1,s2,a,io) => if (F.allowChange(s1,s2)) io.map(_ => a) else IO(a))
@@ -240,9 +240,9 @@ object ScalazReact {
240240
def runStateFS[M[+_], A](st: => StateT[M, S, A])(implicit C: CC, M: M ~> IO, N: Functor[M], F: ChangeFilter[S]): IO[A] =
241241
runStateF(st.liftS)
242242

243-
@deprecated("Instead of _runStateFS(f), use _runStateF(f._liftS). _runStateFS will be removed in 0.7.0.", "0.5.2")
243+
@deprecated("Instead of _runStateFS(f), use _runStateF(f.liftS). _runStateFS will be removed in 0.7.0.", "0.5.2")
244244
def _runStateFS[I, M[+_], A](f: I => StateT[M, S, A])(implicit C: CC, M: M ~> IO, N: Functor[M], F: ChangeFilter[S]): I => IO[A] =
245-
_runStateF(f._liftS)
245+
_runStateF(f.liftS)
246246
}
247247

248248
case class ChangeFilter[S](allowChange: (S, S) => Boolean)

scalaz-7.1/src/main/scala/japgolly/scalajs/react/ScalazReact.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ object ScalazReact {
180180
}
181181

182182
implicit final class SzRExt__StateTOps[I, M[_], S, A](val f: I => StateT[M, S, A]) extends AnyVal {
183-
@inline def _liftS(implicit M: Functor[M]): I => ReactST[M, S, A] = f(_).liftS
183+
@inline def liftS(implicit M: Functor[M]): I => ReactST[M, S, A] = f(_).liftS
184184
}
185185

186186
implicit final class SzRExt_ReactSTOps[M[_], S, A](val s: ReactST[M,S,A]) extends AnyVal {
@@ -222,9 +222,9 @@ object ScalazReact {
222222
def runStateS[M[_], A](st: => StateT[M, S, A])(implicit C: CC, M: M ~> IO, N: Functor[M]): IO[A] =
223223
runState(st.liftS)
224224

225-
@deprecated("Instead of _runStateS(f), use _runState(f._liftS). _runStateS will be removed in 0.7.0.", "0.5.2")
225+
@deprecated("Instead of _runStateS(f), use _runState(f.liftS). _runStateS will be removed in 0.7.0.", "0.5.2")
226226
def _runStateS[I, M[_], A](f: I => StateT[M, S, A])(implicit C: CC, M: M ~> IO, N: Functor[M]): I => IO[A] =
227-
_runState(f._liftS)
227+
_runState(f.liftS)
228228

229229
def runStateF[M[_], A](st: => ReactST[M, S, A])(implicit C: CC, M: M ~> IO, F: ChangeFilter[S]): IO[A] =
230230
run[M, A, A](st, (s1,s2,a,io) => if (F.allowChange(s1,s2)) io.map(_ => a) else IO(a))
@@ -239,9 +239,9 @@ object ScalazReact {
239239
def runStateFS[M[_], A](st: => StateT[M, S, A])(implicit C: CC, M: M ~> IO, N: Functor[M], F: ChangeFilter[S]): IO[A] =
240240
runStateF(st.liftS)
241241

242-
@deprecated("Instead of _runStateFS(f), use _runStateF(f._liftS). _runStateFS will be removed in 0.7.0.", "0.5.2")
242+
@deprecated("Instead of _runStateFS(f), use _runStateF(f.liftS). _runStateFS will be removed in 0.7.0.", "0.5.2")
243243
def _runStateFS[I, M[_], A](f: I => StateT[M, S, A])(implicit C: CC, M: M ~> IO, N: Functor[M], F: ChangeFilter[S]): I => IO[A] =
244-
_runStateF(f._liftS)
244+
_runStateF(f.liftS)
245245
}
246246

247247
case class ChangeFilter[S](allowChange: (S, S) => Boolean)

test/src/test/scala/japgolly/scalajs/react/ScalazTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object ScalazTest extends TestSuite {
2525
val c = null.asInstanceOf[ComponentScopeM[Unit, S, Unit]]
2626

2727
val tests = TestSuite {
28-
"runState(s.liftS)" - test[StateT[M,S,A] ](s => c.runState(s.liftS) ).expect[IO[A]]
29-
"_runState(f._liftS)" - test[B => StateT[M,S,A]](s => c._runState(s._liftS)).expect[B => IO[A]]
28+
"runState(s.liftS)" - test[StateT[M,S,A] ](s => c.runState(s.liftS) ).expect[IO[A]]
29+
"_runState(f.liftS)" - test[B => StateT[M,S,A]](s => c._runState(s.liftS)).expect[B => IO[A]]
3030
}
3131
}

0 commit comments

Comments
 (0)