Opened 7 years ago

Closed 5 years ago

Last modified 4 years ago

#1259 closed bug (invalid)

Accessing undefined value in DiffArray returns misleading error message

Reported by: guest Owned by:
Priority: normal Milestone: 6.12 branch
Component: libraries/base Version: 6.6
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo)

Prelude> :m + Data.Array.Diff
Prelude Data.Array.Diff> :t array
array :: (Ix i, IArray a e) => (i, i) -> [(i, e)] -> a i e
Prelude Data.Array.Diff> array (1,1) [] :: DiffArray Int Int
array (1,1) [(1,*** Exception: MArray: undefined array element

Since DiffArray? isn't a MArray(it implements IArray), this is misleading. It should either say IArray or better DiffArray?: undefined array element.

Change History (6)

comment:1 Changed 7 years ago by igloo

  • Description modified (diff)
  • Milestone set to 6.1

I think the right way to fix this is to wait until we have extensible exceptions, so MArray throws a structured exception. DiffArray? can then s/MArray/DiffArray/ without having to duplicate all the checks.

As such, it's probably something for 6.10.

comment:2 Changed 6 years ago by simonmar

  • Architecture changed from Multiple to Unknown/Multiple

comment:3 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:4 Changed 5 years ago by igloo

  • Milestone changed from 6.10 branch to 6.12 branch
  • Priority changed from low to normal

Raising priority now that we have extensible exceptions.

comment:5 Changed 5 years ago by igloo

  • Resolution set to invalid
  • Status changed from new to closed

diffarray is now in its own package. Ticket moved to here: http://trac.haskell.org/diffarray/ticket/1

comment:6 Changed 4 years ago by simonmar

  • Difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.