Opened 6 years ago

Closed 6 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: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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 6 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 6 years ago by igloo

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

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

Note: See TracTickets for help on using tickets.