haskell - What is the general case of QuickCheck's promote function? -



haskell - What is the general case of QuickCheck's promote function? -

what general term functor construction resembling quickcheck's promote function, i.e., function of form:

promote :: (a -> f b) -> f (a -> b)

(this inverse of flip $ fmap (flip ($)) :: f (a -> b) -> (a -> f b)). there functors such operation, other (->) r , id? (i'm sure there must be). googling 'quickcheck promote' turned quickcheck documentation, doesn't give promote in more general context afaics; searching 'quickcheck promote' produces no results.

(<*>) :: applicative f => f (a -> b) -> f -> f b (=<<) :: monad m => (a -> m b) -> m -> m b

given monad more powerful interface applicative, tell a -> f b can more things f (a -> b). tells function of type (a -> f b) -> f (a -> b) can't injective. domain bigger codomain, in handwavey manner. means there's no way can perchance preserve behavior of function. doesn't work out across generic functors.

you can, of course, characterize functors in operation injective. identity , (->) a examples. i'm willing bet there more examples, nil jumps out @ me immediately.

haskell functional-programming functor quickcheck category-theory

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -