Safe Haskell | None |
---|---|
Language | GHC2021 |
SegAct
instance of range set action over ideomponent monoids. It can set
an interval \([l, r)\) to an idempotent monoid \(x\) such as Max Int
.
Since: 1.0.0
Synopsis
- newtype RangeSetId a = RangeSetId (RangeSetIdRepr a)
- new :: a -> RangeSetId a
- act :: RangeSetId a -> a -> a
RangeSetId
newtype RangeSetId a #
SegAct
instance of range set action over ideomponent monoids.
Example
>>>
import AtCoder.Extra.Monoid (SegAct(..), RangeSetId(..))
>>>
import AtCoder.LazySegTree qualified as LST
>>>
import Data.Semigroup (Max(..))
>>>
seg <- LST.build @_ @(RangeSetId (Max Int)) @(Max Int) $ VU.generate 3 (Max . (+ 10)) -- [10, 11, 12]
>>>
LST.applyIn seg 0 2 $ RangeSetId (True, Max 5) -- [5, 5, 12]
>>>
getMax <$> LST.prod seg 0 3
12
Since: 1.0.0
RangeSetId (RangeSetIdRepr a) |
Instances
Constructor
new :: a -> RangeSetId a #
Creates a new RangeSet
action.
Since: 1.0.0
Action
act :: RangeSetId a -> a -> a #
Applies one-length range set: \(f: x \rightarrow y\).
Since: 1.0.0