type F[_] = List[_]right?
Hello, I'm going through the Functional Programming in Scala and on the chapter about State we have:
case class State[S, +A](run: S => (A, S))
then we have a method
def simulateMachine(inputs: List[Input]): State[Machine, (Int, Int)]
val m: Machine = Machine(true, 5, 10) Candy.simulateMachine(inputs).run(m)
What is making me confused is that "m" is of type machine and "run" expects a "S => (A, S)" function... so how could I pass Machine to "run"?
.run, you access that field