So this is an interesting bit of thought but I&#x27;m trying to figure out what it corresponds to in Haskell. Clearly what they&#x27;re doing with `S` is effectively a `Reader s` monad in `Control.Monad.Reader`, and clearly what they&#x27;re doing with `a -&gt; a` is the `Endo a` monoid in `Data.Monoid`.<p>We can definitely create a `newtype` which composes any applicative with a monoid in the appropriate way:<p><pre><code>    newtype ApMonoid a m = ApMonoid (a m)
    instance (Applicative a, Monoid m) =&gt; Monoid (ApMonoid a m) where
        mempty = pure mempty
        mappend (ApMonoid x) (ApMonoid y) = Wrap $ mappend &lt;$&gt; x &lt;*&gt; y
</code></pre>
Then they have two data types: (1) they pull in a bunch of `Extras` up front and then each transformer successively pares down the extras to some subset of data that it cares about, then (2) each function transforms the search `Results`. We could say that this is:<p><pre><code>    data Extras = Extras {e1 :: {- type1 -}, e2 :: {- type2 -}, ... eN :: {- typeN -}}
</code></pre>
and their resulting transformation looks like:<p><pre><code>    transN (eN extra) . ... . trans2 (e2 extra) . trans1 (e1 extra) :: Results -&gt; Results
</code></pre>
so I guess I&#x27;m trying to store `transN . eN` as something like an `ApMonoid (Reader Extras) (Endo Results)` via the above. The logic looks pretty solid.<p>However, if it doesn&#x27;t kill the basic logic, it might be more Haskell-y to compose these by lifting the monoid to an applicative using `Const`, so that in this case:<p><pre><code>    newtype ApAp a b x = ApAp (a (b x)) deriving (Functor)
    instance (Applicative a, Applicative b) =&gt; Applicative (ApAp a b) where
        pure = pure . pure
        (&lt;*&gt;) = liftA2 (&lt;*&gt;)
</code></pre>
We would instead say that this is `ApAp (Reader Extras) (Const (Endo Results))`. Can anyone with more experience with such things comment on whether those are the same? I&#x27;m a little shaky here.<p>Also, there&#x27;s no generic way to &quot;drop&quot; an applicative to be simply a monoid, right? We need an existing Monoid to feed to `ApMonoid`, no?