Opened 9 years ago

Closed 9 years ago

#2525 closed bug (invalid)

maps created by Data.Map.fromAscList fail lookup on some keys present

Reported by: guest Owned by:
Priority: normal Milestone:
Component: libraries/base Version: 6.8.2
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


import Data.Map
member "foo" $ fromAscList [("foo", True), ("bar", False)]

The above expression evaluates to False, when it should clearly be True. This works fine when fromList is used instead.

Tested on 6.8.2, but I don't see anything in the release notes vaguely related for 6.8.3.

Change History (2)

comment:1 Changed 9 years ago by tibbe

The documentation for fromAscList states:

"O(n). Build a map from an ascending list in linear time. The precondition (input list is ascending) is not checked."

Your list is descending.

comment:2 Changed 9 years ago by igloo

difficulty: Unknown
Resolution: invalid
Status: newclosed

tibbe is right, so I'm closing the bug.

Note: See TracTickets for help on using tickets.