Open JamesGallicchio opened 8 months ago
I haven't yet checked what Haskell libraries do. Could be a useful source.
What about Dict
or Dictionary
?
Gonna wait until the 4.8 release to add a Map
class, so the deprecation notice sticks around for at least a little while.
Functor
only applies to type constructors (Type u -> Type v
). So, is insufficient for a general purposemap : (A -> B) -> CA -> CB
where perhapsCA
andCB
cannot contain arbitrary element types.Example:
Functor ByteArray
does not typecheck, even though we can givemap : (Byte -> Byte) -> ByteArray -> ByteArray
Suggested implementation:
This conflicts with the current
Map
class (which is the bag of associations abstraction commonly called aMap
in other languages).We could
MapOp
? Since we willexport MapOp (map)
it will still be visible, but with the current naming scheme, theorems about map will end up in theMapOp.theorems_about_map
namespace.Map
toMapBag
or similar. I don't .. hate this solution? because it emphasizes the class's relationship toBag
, but this goes against other languages with interfaces namedMap
.