It strikes me as quite strange and somewhat unfortunate that conquer is a method of Divisible. I really think it should be in a subclass. The fundamental idea of Divisible is it's for problems that can be handled in arbitrary pieces. The notion of a default handler looks like extra power on top of that. Here's a simple example:
newtype Flipparr a b = Fliparr {unfliparr :: b -> a}
instance Semigroup a => Divisible (Fliparr) a where
divide f (Fliparr g) (Fliparr h) = Fliparr $ \a ->
case f a of
(b, c) -> g b <> h c
To get conquer, this needs a Monoid constraint.
So I think Divisible should drop conquer, and there should be a separate class for that.
It strikes me as quite strange and somewhat unfortunate that
conqueris a method ofDivisible. I really think it should be in a subclass. The fundamental idea ofDivisibleis it's for problems that can be handled in arbitrary pieces. The notion of a default handler looks like extra power on top of that. Here's a simple example:To get
conquer, this needs aMonoidconstraint.So I think
Divisibleshould dropconquer, and there should be a separate class for that.