SignallingSortedMapRef

calico.frp.SignallingSortedMapRef$
See theSignallingSortedMapRef companion class

Attributes

Companion:
class
Source:
SignallingSortedMapRef.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Concrete methods

def State.this._1 case1=> State.this._2 case2=> State.this._3 case3=> State.this._4 case_=> thrownewIndexOutOfBoundsException(n.toString()) } } objectStateextendsAnyRefwithProduct{ overridedeftoString:String="State" typeMirroredMonoType deffromProduct(`x$0₃`:Product):MirroredMonoType=newState(`x$0₃`.productElement(0).$asInstanceOf$[SortedMap[K,V]],`x$0₃`.productElement(1).$asInstanceOf$[Long],`x$0₃`.productElement(2).$asInstanceOf$[LongMap[Deferred[F,Tuple2[SortedMap[K,V],Long]]]],`x$0₃`.productElement(3).$asInstanceOf$[Map[K,LongMap[Deferred[F,Tuple2[Option[V],Long]]]]]) } finallazyvalgiven_Ordering_K:Ordering[K]=K.toOrdering toFunctorOps[F,Tuple2[Ref[F,State],Ref[F,Long]]](catsSyntaxSemigroupal[F,Ref[F,State]](F.ref[State](State.apply(SortedMap.empty[K,Nothing](given_Ordering_K),0L,LongMap.empty[Deferred[F,Tuple2[SortedMap[K,V],Long]]],SortedMap.empty[K,Nothing](given_Ordering_K))))(F).product[Ref[F,Long]](F.ref[Long](1L)))(F).map[SignallingSortedMapRef[F,K,V]](((x$1:Tuple2[Ref[F,State],Ref[F,Long]])=>x$1match{ caseTuple2(state,ids)=> valnewId:F[Long]=ids.getAndUpdate(((_$3:Long)=>_$3.+(1))) deftraverse_[A,U](it:Iterable[A])(f:Function1[A,F[U]]):F[Unit]=it.foldLeft[F[Unit]](F.unit)(((_$4:F[Unit],_$5:A)=>catsSyntaxApply[F,Unit](_$4)(F).<*[U](f.apply(_$5)))) defupdateMapAndNotify[O](state:State,`f₂`:Function1[SortedMap[K,V],Tuple2[SortedMap[K,V],O]]):Tuple2[State,F[O]]={ val$1$:Tuple2[SortedMap[K,V],O]=(`f₂`.apply(state.value):@unchecked)match{ caseTuple2(newValue,result)=> Tuple2.apply[SortedMap[K,V],O](newValue,result) } val`newValue₂`:SortedMap[K,V]=$1$._1 val`result₂`:O=$1$._2 val`lastUpdate₂`:Long=state.lastUpdate.+(1) valnewState:State=State.apply(`newValue₂`,`lastUpdate₂`,LongMap.empty[Deferred[F,Tuple2[SortedMap[K,V],Long]]],SortedMap.empty[K,Nothing](given_Ordering_K)) valnotifyListeners:F[Unit]=traverse_[Deferred[F,Tuple2[SortedMap[K,V],Long]],Boolean](state.listeners.values)(((_$6:Deferred[F,Tuple2[SortedMap[K,V],Long]])=>_$6.complete(ArrowAssoc[SortedMap[K,V]](`newValue₂`).->[Long](`lastUpdate₂`)))) valnotifyKeyListeners:F[Unit]=traverse_[Tuple2[K,LongMap[Deferred[F,Tuple2[Option[V],Long]]]],Unit](state.keyListeners)(((`x$1₂`:Tuple2[K,LongMap[Deferred[F,Tuple2[Option[V],Long]]]])=>{ valk:K=`x$1₂`._1 val`listeners₂`:LongMap[Deferred[F,Tuple2[Option[V],Long]]]=`x$1₂`._2 valv:Option[V]=`newValue₂`.get(k) traverse_[Deferred[F,Tuple2[Option[V],Long]],Boolean](`listeners₂`.values)(((_$7:Deferred[F,Tuple2[Option[V],Long]])=>_$7.complete(ArrowAssoc[Option[V]](v).->[Long](`lastUpdate₂`)))) })) ArrowAssoc[State](newState).->[F[O]](toFunctorOps[F,Unit](catsSyntaxApply[F,Unit](notifyListeners)(F).*>[Unit](notifyKeyListeners))(F).as[O](`result₂`)) } defupdateKeyAndNotify[U](`state₂`:State,`k₂`:K,`f₃`:Function1[Option[V],Tuple2[Option[V],U]]):Tuple2[State,F[U]]={ val$2$:Tuple2[Option[V],U]=(`f₃`.apply(`state₂`.value.get(`k₂`)):@unchecked)match{ caseTuple2(newValue,result)=> Tuple2.apply[Option[V],U](`newValue₃`,`result₃`) } val`newValue₄`:Option[V]=$2$._1 val`result₄`:U=$2$._2 valnewMap:SortedMap[K,V]=`newValue₄`.fold[SortedMap[K,V]](`state₂`.value.-(`k₂`))(((`v₂`:V)=>`state₂`.value.+[V](ArrowAssoc[K](`k₂`).->[V](`v₂`)))) val`lastUpdate₃`:Long=`state₂`.lastUpdate.+(1) valnewKeyListeners:Map[K,LongMap[Deferred[F,Tuple2[Option[V],Long]]]]=`state₂`.keyListeners.-(`k₂`) val`newState₂`:State=State.apply(newMap,`lastUpdate₃`,LongMap.empty[Deferred[F,Tuple2[SortedMap[K,V],Long]]],newKeyListeners) val`notifyListeners₂`:F[Unit]=traverse_[Deferred[F,Tuple2[SortedMap[K,V],Long]],Boolean](`state₂`.listeners.values)(((_$8:Deferred[F,Tuple2[SortedMap[K,V],Long]])=>_$8.complete(ArrowAssoc[SortedMap[K,V]](newMap).->[Long](`lastUpdate₃`)))) val`notifyKeyListeners₂`:F[Unit]=`state₂`.keyListeners.get(`k₂`).fold[F[Unit]](F.unit)(((`listeners₃`:LongMap[Deferred[F,Tuple2[Option[V],Long]]])=>traverse_[Deferred[F,Tuple2[Option[V],Long]],Boolean](`listeners₃`.values)(((_$9:Deferred[F,Tuple2[Option[V],Long]])=>_$9.complete(ArrowAssoc[Option[V]](`newValue₄`).->[Long](`lastUpdate₃`)))))) ArrowAssoc[State](`newState₂`).->[F[U]](toFunctorOps[F,Unit](catsSyntaxApply[F,Unit](`notifyListeners₂`)(F).*>[Unit](`notifyKeyListeners₂`))(F).as[U](`result₄`)) } { finalclass$anon()extendsSignallingSortedMapRef[F,K,V]withAbstractSignallingRef[F,State,SortedMap[K,V]](newId,`state₃`)(F){outer:$anon=> defgetValue(s:State):SortedMap[K,V]=s.value defgetLastUpdate(`s₂`:State):Long=`s₂`.lastUpdate defwithListener(`s₃`:State,id:Long,wait:Deferred[F,Tuple2[SortedMap[K,V],Long]]):State={ vallisteners$1:LongMap[Deferred[F,Tuple2[SortedMap[K,V],Long]]]=`s₃`.listeners.updated[Deferred[F,Tuple2[SortedMap[K,V],Long]]](id,wait) valvalue$1:SortedMap[K,V]@uncheckedVariance=`s₃`.copy$default$1 vallastUpdate$1:Long@uncheckedVariance=`s₃`.copy$default$2 valkeyListeners$1:Map[K,LongMap[Deferred[F,Tuple2[Option[V],Long]]]]@uncheckedVariance=`s₃`.copy$default$4 `s₃`.copy(value$1,lastUpdate$1,listeners=listeners$1,keyListeners$1) } defwithoutListener(`s₄`:State,`id₂`:Long):State={ vallisteners$2:LongMap[Deferred[F,Tuple2[SortedMap[K,V],Long]]]=`s₄`.listeners.removed(`id₂`) valvalue$2:SortedMap[K,V]@uncheckedVariance=`s₄`.copy$default$1 vallastUpdate$2:Long@uncheckedVariance=`s₄`.copy$default$2 valkeyListeners$2:Map[K,LongMap[Deferred[F,Tuple2[Option[V],Long]]]]@uncheckedVariance=`s₄`.copy$default$4 `s₄`.copy(value$2,lastUpdate$2,listeners=listeners$2,keyListeners$2) } defupdateAndNotify[O](`s₅`:State,`f₄`:Function1[SortedMap[K,V],Tuple2[SortedMap[K,V],O]]):Tuple2[State,F[O]]=updateMapAndNotify[O](`s₅`,`f₄`) defkeys:Signal[F,SortedSet[K]]={ finalclass$anon()extendsSignal[F,SortedSet[K]]{ defget:F[SortedSet[K]]=toFunctorOps[F,SortedMap[K,V]]($anon.this.get)(F).map[SortedSet[K]](((_$10:SortedMap[K,V])=>_$10.keySet)) defcontinuous:Stream[F,SortedSet[K]]=$anon.this.continuous.map[SortedSet[K]](((_$11:SortedMap[K,V])=>_$11.keySet)) defdiscrete:Stream[F,SortedSet[K]]=$anon.this.discrete.map[SortedSet[K]](((_$12:SortedMap[K,V])=>_$12.keySet)).changes[SortedSet[K]](catsKernelOrderForSortedSet[K](K)) } (new$anon():Signal[F,SortedSet[K]]) } defapply(`k₃`:K):SignallingRef[F,Option[V]]={ finalclass$anon()extendsSignallingRef[F,Option[V]]withAbstractSignallingRef[F,State,Option[V]](newId,`state₃`)(F){ defgetValue(`s₆`:State):Option[V]=`s₆`.value.get(`k₃`) defgetLastUpdate(`s₇`:State):Long=`s₇`.lastUpdate defwithListener(`s₈`:State,`id₃`:Long,`wait₂`:Deferred[F,Tuple2[Option[V],Long]]):State={ valkeyListeners$3:Map[K,LongMap[Deferred[F,Tuple2[Option[V],Long]]]]=`s₈`.keyListeners.updatedWith[LongMap[Deferred[F,Tuple2[Option[V],Long]]]](`k₃`)(((_$13:Option[LongMap[Deferred[F,Tuple2[Option[V],Long]]]])=>catsSyntaxOptionId[LongMap[Deferred[F,Tuple2[Option[V],Long]]]](_$13.getOrElse[LongMap[Deferred[F,Tuple2[Option[V],Long]]]](LongMap.empty[Nothing]).updated[Deferred[F,Tuple2[Option[V],Long]]](`id₃`,`wait₂`)).some)) valvalue$3:SortedMap[K,V]@uncheckedVariance=`s₈`.copy$default$1 vallastUpdate$3:Long@uncheckedVariance=`s₈`.copy$default$2 vallisteners$3:LongMap[Deferred[F,Tuple2[SortedMap[K,V],Long]]]@uncheckedVariance=`s₈`.copy$default$3 `s₈`.copy(value$3,lastUpdate$3,listeners$3,keyListeners=keyListeners$3) } defwithoutListener(`s₉`:State,`id₄`:Long):State={ valkeyListeners$4:Map[K,LongMap[Deferred[F,Tuple2[Option[V],Long]]]]=`s₉`.keyListeners.updatedWith[LongMap[Deferred[F,Tuple2[Option[V],Long]]]](`k₃`)(((_$14:Option[LongMap[Deferred[F,Tuple2[Option[V],Long]]]])=>_$14.map[LongMap[Deferred[F,Tuple2[Option[V],Long]]]](((_$15:LongMap[Deferred[F,Tuple2[Option[V],Long]]])=>_$15.removed(`id₄`))).filterNot(((_$16:LongMap[Deferred[F,Tuple2[Option[V],Long]]])=>_$16.isEmpty)))) valvalue$4:SortedMap[K,V]@uncheckedVariance=`s₉`.copy$default$1 vallastUpdate$4:Long@uncheckedVariance=`s₉`.copy$default$2 vallisteners$4:LongMap[Deferred[F,Tuple2[SortedMap[K,V],Long]]]@uncheckedVariance=`s₉`.copy$default$3 `s₉`.copy(value$4,lastUpdate$4,listeners$4,keyListeners=keyListeners$4) } defupdateAndNotify[O](`s₁₀`:State,`f₅`:Function1[Option[V],Tuple2[Option[V],O]]):Tuple2[State,F[O]]=updateKeyAndNotify[O](`s₁₀`,`k₃`,`f₅`) } (new$anon():AbstractSignallingRef[F,State,Option[V]]) } } (new$anon():SignallingSortedMapRef[F,K,V]&AbstractSignallingRef[F,State,SortedMap[K,V]]) } })) }" t="n"class="documentableName ">apply[F[_], K, V](using F: Concurrent[F], K: Order[K]): F[SignallingSortedMapRef[F, K, V]]