Preface_specs.ChoiceChoice is a Profunctor working on sum types (via Either).
To have a predictable behaviour, the instance of Strong must obey some laws.
Profunctor lawsleft = dimap Either.swap Either.swap % rightright = dimap Either.swap Either.swap % leftmap_snd Either.left = contramap_fst Either.left % leftmap_snd Either.right = contramap_fst Either.right % rightcontramap_fst (Fun.Choice.right f) % left = map_snd (Fun.Choice.right f) % leftcontramap_fst (Fun.Choice.left f) % right = map_snd (Fun.Choice.left f) % rightleft % left = dimap assoc unassoc % leftleft % left = dimap unassoc assoc % rightmodule type WITH_LEFT = sig ... endMinimal interface using left and without Profunctor.
module type WITH_RIGHT = sig ... endMinimal interface using right and without Profunctor.
module type WITH_DIMAP_AND_LEFT = sig ... endMinimal interface dimap and left.
module type WITH_CONTRAMAP_FST_AND_MAP_SND_AND_LEFT = sig ... endMinimal interface using contramap_fst and map_snd and left.
module type WITH_DIMAP_AND_RIGHT = sig ... endMinimal interface using dimap and right.
module type WITH_CONTRAMAP_FST_AND_MAP_SND_AND_RIGHT = sig ... endMinimal interfaces using contramap_fst and map_snd and right.
module type CORE = sig ... endBasis operations.
module type API = sig ... endThe complete interface of a Choice Profunctor.