Created
November 8, 2018 21:45
-
-
Save kozross/a2862aee7bdae17632aa268b7586dc94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Suppose these are the mappings: | |
mappingsAsList :: [((Int,Int), Bool)] | |
mappingsAsList [((1,2), True), ((1,3), False), ((1,4), True), | |
((2,4), True), ((2,5), False), ((2,6), True)] | |
-- I wanna be able to efficiently request 'give me all mappings where the first part of the key is x'. | |
-- For instance, if I asked for x = 1, I should get [((1,2), True), ((1,3), False), ((1,4), True)] | |
-- I also wanna be able to efficiently request 'give me all mappings where the second part of the key is y'. | |
-- For instance, if I asked for y = 4, I should get [((1,4), True), ((2,4), True)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment