containers
containers copied to clipboard
Loosen superclass bounds for type class instances for merge tactics
The merge tactic types (WhenMissing f a b and WhenMatched f a b c) implement a number of type classes (Category, Monad, Applicative, and Functor). All of these instances except for Functor (WhenMatched f a b c) have (Applicative f, Monad f) constraints, yet only Category and Monad need those constraints. It seems unlikely that any further optimization would need those constraints either.
Instead, there could be
instance Functor f => Functor (WhenMissing f a b)
instance Applicative f => Applicative (WhenMissing f a b)
instance Functor f => Functor (WhenMatched f a b c) -- already present
instance Applicative f => Applicative (WhenMatched f a b c)
Is this really possible with MaybeT semantics?