You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enumCounterInput[Response]:caseIncextendsCounterInput[Unit]
caseDecextendsCounterInput[Unit]
caseGetextendsCounterInput[Int]
defcounterBehaviorK[O]: (Int, CounterInput[O]) => (Int, O) =case (s, CounterInput.Inc) =>
(s +1, ())
case (s, CounterInput.Dec) =>
(s +1, ())
case (s, CounterInput.Get) =>
(s, s)
// not sure how to pass this behavior parameterdefdoSth[S, I[_]](behavior: [O] => (S, I[O]) => (S, O)) = println("Hi")
doSth[Int, CounterInput]([O] => counterBehaviorK[O]) // Implementation restriction: polymorphic function literals must have a value parameter
doSth[Int, CounterInput](counterBehaviorK) // Also error