Created
August 11, 2017 02:02
-
-
Save chetkhatri/3ba562b7d217d0ee0d7a8fa61bea48c7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| that depends on you use case, but a Map[Key, List[Value]] could work if you need key lookup | |
| a more typesafe alternative would be a Map[Key, NonEmptyList[Value]], but you'd have to get the NonEmptyList from somewhere else | |
| the simplest would be just something like a List[(Key, Value)] | |
| you could also look in to a Vector[(Key, Value)] sorted by key so you can binary search on it and such | |
| Options aplenty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment