module Data.Monoid.Reducer.With
( module Data.Monoid.Reducer
, WithReducer(WithReducer,runWithReducer)
, withoutReducer
) where
import Data.Monoid.Reducer
import Data.FingerTree
newtype WithReducer c m = WithReducer { runWithReducer :: (m,c) }
withoutReducer :: c `WithReducer` m -> c
withoutReducer = snd . runWithReducer
instance (c `Reducer` m) => Reducer (c `WithReducer` m) m where
unit = fst . runWithReducer
instance (c `Reducer` m) => Measured m (c `WithReducer` m) where
measure = fst . runWithReducer