Closed ajwheeler closed 10 years ago
I'm not familiar with that library...could you explain the benefits?
Many of the functions are for fancy combinatorics, but the core of the library is the multiset (a mathematical set that can contain multiples of elements). It's basically a [(a, Int)]
but with some nice helper functions.
I think something like this is a more natural fit for keeping track of all the cards. Of course there are other good options (perhaps a Map Card Int
).
There is also the option of directly using a list of tuples. Data.List
provides a nice function
lookup :: Eq a => a -> [(a, b)] -> Maybe b
The Map
option sounds good to me. If you send over a pull request, I'll merge it in.
Would you be interested in me replacing
_cards
inGameState
with a more efficient data structure? Perhaps with this library. I realize that it's not a huge deal since the number of cards in a game isn't massive, but I think it would be bennificial.