{-# OPTIONS_GHC -Wno-orphans #-}

module Data.SegTree.RangeMulRangeSum where

import Data.Coerce
import Data.SegTree
import Data.Semigroup

instance (Num a) => AsSemigroupEndo (Dual (Product a)) (Sum a) where
  sendo :: Dual (Product a) -> Sum a -> Sum a
sendo = (a -> a -> a) -> Dual (Product a) -> Sum a -> Sum a
forall a b. Coercible a b => a -> b
coerce (forall a. Num a => a -> a -> a
(*) @a)
  {-# INLINE sendo #-}