Ticket #1691 (closed bug: fixed)
Data.Map.deleteAt broken with index 0
Description
Take a look at this ghci session:
Prelude> :m Data.Map Prelude Data.Map> Data.Map.deleteAt 0 (Data.Map.fromList [(0::Int, 0::Int), (1,1), (2, 2), (3, 3)]) fromList [] Prelude Data.Map> Data.Map.elemAt 0 (Data.Map.fromList [(0::Int, 0::Int), (1,1), (2, 2), (3, 3)]) (0,0)
In other words, deleteAt with index 0 deletes *everything* in the map, not just the first element in it.
Prelude Data.Map> Data.Map.deleteAt 1 (Data.Map.fromList [(0::Int, 0::Int), (1,1), (2, 2), (3, 3)]) fromList [(0,0),(2,2),(3,3)]
That appears to work as it should. It seems that there is something wrong with an index of 0.
Change History
Note: See
TracTickets for help on using
tickets.
