[Haskell-cafe] Applicative functors with branch/choice ?

Ross Paterson ross at soi.city.ac.uk
Thu Jul 26 10:48:53 CEST 2012

On Wed, Jul 25, 2012 at 09:22:23PM +0100, Евгений Пермяков wrote:
> So, it seems for me, that Applicative API should be extended with 
> typeclass for making choice what actions to execute depending on result 
> of some test (pattern matching). Is there any reasonable definition of 
> such typeclass or clear explanation, why such typeclass is unneeded?
> The possible extension may look somehow like this:
> class Applicative a => Branching a where
>   branch :: a (Either b c) -> (a b -> a d) -> (a c -> a d) -> a d

Do you have any instances in mind?

More information about the Haskell-Cafe mailing list