On Tue 12 May, Frank A. Christoph wrote:
> I'm experiencing a little bout of deja vu here, so excuse me if it turns out
> that I'm repeating myself. (I could swear I already posted this, but it's
> not in my "Messages Sent" folder...)
>
> With regard to merging Either instances, I agree with Simon that for most
> programs this will not buy you much, but there are two common kinds of
> programs where one could expect a significant effect on performance, just
> because of sheer scale. The first is any program which uses an
> error/exception monad on a program-wide scale. The second is a program that
> uses Chalmers' fudgets library since, as I recall, the type Either plays a
> prominent role in the "messaging" system.
I just caught this one...
Precisely, I myself have written a parser in which functions similar to
'demo' appear all over the place. Either is a common data type to use to
represent Success or Failure/Exceptions.
The same problem is also apparent with the use of Maybe. In fact, just
about every algebraic type I can think of will have some constructors
that don't reference every type argument, and can therefore be regarded
as 'more polymorphic' when they appear in patterns.
Regards
--
Adrian Hey