What is the general term for a functor with a structure resembling QuickCheck's promote
function, i.e., a function of the form:
promote :: (a -> f b) -> f (a -> b)
(this is the inverse of flip $ fmap (flip ($)) :: f (a -> b) -> (a -> f b)
). Are there even any functors with such an operation, other than (->) r
and Id
? (I'm sure there must be). Googling 'quickcheck promote' only turned up the QuickCheck documentation, which doesn't give promote
in any more general context AFAICS; searching SO for 'quickcheck promote' produces no results.
sequenceA
relevant? – EthiopiansequenceA
, we would gett = (->) a
andf = f
. So if(->) a
had aTraversable
instance, this function would exist for alla
. I thinkTraversable ((->) a)
requires(Bounded a, Enum a)
of or the equivalent, though. – GoddenTraversable
instance. – GratulantFinite
, which I guess is essentially the same thing. – Godden