error vs Maybe in Collections package
Robert Dockins
robdockins at fastmail.fm
Wed Jun 7 17:03:51 EDT 2006
On Jun 7, 2006, at 4:44 PM, Jean-Philippe Bernardy wrote:
> Good idea. I added a ticket.
>
> http://cvs.haskell.org/trac/ghc/ticket/792
>
> If there is no taker I'll try to do it this weekend.
I've just realized that I typo'd the Edison names for these
operations. It would be unfortunate to introduce needless name
differences, so I'd like to point out that the Edison names for these
operations are actually:
minView
and
maxView
> Cheers,
> JP.
>
> On 6/6/06, Robert Dockins <robdockins at fastmail.fm> wrote:
>>
>> On Jun 6, 2006, at 9:57 AM, David F. Place wrote:
>>
>> > It bothers me that the functions findMin, findMax, deleteFindMin
>> > and deleteFindMax are error when applied to the empty set in
>> > various types of collections. Shouldn't they return Maybe?
>>
>>
>> FYI, Edison has operations that generalize 'deleteFind*' (named
>> viewMin/viewMax) which call 'fail' in an arbitrary monad when applied
>> to an empty collection; obviously, these can be instantiated at type
>> 'Maybe'.
>>
>> http://www.eecs.tufts.edu/~rdocki01/docs/edison/Data-Edison-
>> Coll.html#v%3AminView
Rob Dockins
Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
-- TMBG
More information about the Libraries
mailing list