proposal #4095: add Applicative instance for Either

Iavor Diatchki iavor.diatchki at gmail.com
Mon May 31 13:18:11 EDT 2010


Hello,
Are there any uses of this instance that are not related to error
handing?  If not, I would propose that we avoid prolonging the
confusing use of "Either" for error handling and define a separate
type with properly labelled constructors, to be used as "Maybe" but
with multiple reasons for failure.
-Iavor

On Wed, May 26, 2010 at 4:44 AM, Ross Paterson <ross at soi.city.ac.uk> wrote:
> Ashley Yakeley <ashley at semantic.org> writes:
>> I currently have my own implementations for these:
>
>>      instance Foldable Identity
>>      instance Traversable Identity
>>      instance Applicative Identity
>
> The transformers package has such instances (but currently for a different
> Identity type).
>
>>      instance Foldable (Either p)
>>      instance Traversable (Either p)
>>      instance Applicative (Either p)
>
>>      instance Foldable ((,) p)
>>      instance Traversable ((,) p)
>
> The Applicative one is proposed here.  The others should also be added.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>


More information about the Libraries mailing list