-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
name change proposal (EnumMap => Map, EnumSet => Set) #9
Comments
ping |
Hi! I'm your new maintainer. :) I'm not strongly opposed, but I imagine some people may import the type not qualified. I don't understand the comment about |
Hi. Yes, same thing - Data.HashMap should define a type named Possibly this can be done via backpack in the future ( https://ghc.haskell.org/trac/ghc/wiki/Backpack ) It's not exactly high priority, as I can use a work-around mentioned here https://mail.haskell.org/pipermail/haskell-cafe/2018-September/129940.html (switching via type classes). |
Interesting. As long as backward compatibility is preserved, feel free to experiment. This package is not particularly fragile or complex, so a few type synonyms, or something more, won't hurt. |
Now that I think about, it we'd probably want to follow |
So the pattern I see frequently (and apply myself) is ("default culture"): import Data.Map (Map)
import Data.Map qualified as Map
import Data.IntMap (IntMap)
import Data.IntMap qualified as IntMap This would not be possible if all the map types would just be called In the ML world (PL ML, not AI ML), it is common to use the carrier type of a module import Data.Map qualified as Map
import Data.IntMap qualified as IntMap
type Map = Map.T
type IntMap = IntMap.T The proposal seems to breathe this spirit. I think staying in sync with the default culture is overall more beneficial. |
The name (EnumMap) seems wrong, though. The module will
be imported qualified anyways, so the type should just be Map.
Then, changing the implementation (if the key type implements
Ord, Enum, and Hashable) is really just changing the import.
But then, it's at least consistently wrong -
e.g., in line with Data.HashMap.
see also discussion in this thread: https://mail.haskell.org/pipermail/haskell-cafe/2015-March/118897.html
The text was updated successfully, but these errors were encountered: