| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
AtCoder.Extra.Monoid.RangeAdd
Contents
Description
Monoid action \(f: x \rightarrow x + d\).
Since: 1.0.0.0
RangeAdd
Monoid action \(f: x \rightarrow x + d\).
Example
>>>import AtCoder.Extra.Monoid (SegAct(..), RangeAdd(..))>>>import AtCoder.LazySegTree qualified as LST>>>import Data.Semigroup (Max(..))>>>seg <- LST.build @_ @(RangeAdd (Sum Int)) @(Sum Int) $ VU.generate 3 Sum -- [0, 1, 2]>>>LST.applyIn seg 0 3 $ RangeAdd (Sum 5) -- [5, 6, 7]>>>getSum <$> LST.prod seg 0 318
Since: 1.0.0.0
Constructors
| RangeAdd a |
Instances
Constructor
unRangeAdd :: RangeAdd a -> a Source #
\(O(1)\) Retrieves the internal value of RangeAdd.
Since: 1.1.0.0