Hedgehog has an HTraversable class defined like this:
-- | Higher-order traversable functors.
--
class HTraversable t where
htraverse :: Applicative f => (forall a. g a -> f (h a)) -> t g -> f (t h)
Which is used with their Var type for parameterizing a type over whether values are concrete or abstract. t has kind (* -> *) -> * and is a higher order functor although they don't actually have that class, f, g and h have kind * -> *. I've seen the same thing defined in a few different libraries.
Is there a way to get an optic out of this? I confess I don't know what that would even do, and I'm not super comfortable with lenses or regular Traversable either.
Sure.
Remember,
lens'sTraversalcomes about by taking the type oftraverseand letting thet aandt btypes vary, viewing the traversable not as a polymorphic container but as a monolithic blob.How useful
HTraversalis, I dunno. You can't compose them nicely with(.).