, , .
, , f' m a -> m a -> m a. f f', join, Monad. , .
(Maybe a, Maybe a), , These. ,
data These a b = That a | This b | These a b
unionWith' f a b = let theses = unionWith These (That <$> a) (This <$> b)
in sequenceA (f' <$> theses)
where f' (That a) = pure a
f' (This b) = pure b
f' (These a b) = f a b
these,
unionWith'' f a b = sequenceA $ alignWith (these pure pure f) a b