Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 540 Bytes

Alternative.md

File metadata and controls

17 lines (11 loc) · 540 Bytes

MODULE Alternative

Alternative

type class

interface Alternative<F> extends Applicative<F>, Plus<F> {}

The Alternative type class has no members of its own; it just specifies that the type constructor has both Applicative and Plus instances.

Types which have Alternative instances should also satisfy the following laws:

  1. Distributivity: A.ap(A.alt(fab, gab), fa) = A.alt(A.ap(fab, fa), A.ap(gab, fa))
  2. Annihilation: A.ap(zero, fa) = zero