Preface_specs.ProfunctorA Profunctor is a type constructor that takes two type arguments and is a Contravariant Functor as first argument and a covariant Functor as second argument.
To have a predictable behaviour, the instance of Bifunctor must obey some laws.
dimap id id = idcontramap_fst id = idmap_snd id = iddimap f g = contramap_fst f % map_snd gdimap (f % g) (h % i) = dimap g h % dimap f icontramap_fst (f % g) = contramap_fst g % contramap_fst fmap_snd (f % g) = map_snd f % map_snd gmodule type WITH_DIMAP = sig ... endMinimal interface using dimap.
module type WITH_CONTRAMAP_FST_AND_MAP_SND = sig ... endMinimal interface using contramap_fst and map_snd.
module type CORE = sig ... endBasis operations.
module type API = COREThe complete interface of a Profunctor.