package Ġarrow . mt l . extensions Ċ Ċ import Ġarrow . Kind Ċ import Ġarrow . core . to T Ċ import Ġarrow . data . State T Ċ import Ġarrow . data . State TP art ial Of Ċ import Ġarrow . data . extensions . State T Monad Ċ import Ġarrow . data . extensions . State TS em ig roup K Ċ import Ġarrow . extension Ċ import Ġarrow . mt l . type classes . Monad Combine Ċ import Ġarrow . mt l . type classes . Monad State Ċ import Ġarrow . core . type classes . Monad Ċ import Ġarrow . core . type classes . Sem ig roup K Ċ Ċ @ extension Ċ interface ĠState T Monad State < F , ĠS > Ġ: ĠMonad State < State TP art ial Of < F , ĠS >, ĠS >, ĠState T Monad < F , ĠS > Ġ{ ĊĊĠ Ġoverride Ġfun ĠMF (): ĠMonad < F > ĊĊĠ Ġoverride Ġfun Ġget (): ĠState T < F , ĠS , ĠS > Ġ= ĠState T . get ( MF ()) ĊĊĠ Ġoverride Ġfun Ġset ( s : ĠS ): ĠState T < F , ĠS , ĠUnit > Ġ= ĠState T . set ( MF (), Ġs ) Ċ } Ċ Ċ @ extension Ċ interface ĠState T Monad Combine < F , ĠS > Ġ: ĠMonad Combine < State TP art ial Of < F , ĠS >>, ĠState T Monad < F , ĠS >, ĠState TS em ig roup K < F , ĠS > Ġ{ ĊĊĠ Ġfun ĠMC (): ĠMonad Combine < F > ĊĊĠ Ġoverride Ġfun ĠMF (): ĠMonad < F > Ġ= ĠMC () ĊĊĠ Ġoverride Ġfun ĠFF (): ĠMonad < F > Ġ= ĠMC () ĊĊĠ Ġoverride Ġfun ĠSS (): ĠSem ig roup K < F > Ġ= ĠMC () ĊĊĠ Ġoverride Ġfun Ġ< A > Ġempty (): ĠKind < State TP art ial Of < F , ĠS >, ĠA > Ġ= Ġlift T ( MC (). empty ()) ĊĊĠ Ġfun Ġ< A > Ġlift T ( ma : ĠKind < F , ĠA >): ĠState T < F , ĠS , ĠA > Ġ= ĠFF (). run Ġ{ ĊĠĠĠ ĠState T ( just ({ Ġs : ĠS Ġ-> Ġma . map Ġ{ Ġa : ĠA Ġ-> Ġs Ġto T Ġa Ġ} Ġ})) ĊĠ Ġ} Ċ } Ċ