performance for access value from map may be worse than access from var. this is for inlining. my hunch is that compiler can inline var but can not inline field stored inside map.
someone can override values in map. (albeit they can override values of exported var-s too, but that is more strange)
code editors should be able to detect type better in type hints if it is exported as var and not inside map. (likely)
maybe I am missing something! just unusual to see enums exported inside map.
motivation is three-fold:
var
. this is for inlining. my hunch is that compiler can inlinevar
but can not inline field stored inside map.var
and not inside map. (likely)maybe I am missing something! just unusual to see enums exported inside map.
here is one very good enum: https://github.com/ferdypruis/iso4217 (it has map internally, but does not expose it) but eventually I moved away from map into just var symbols: http://github.com/nikolaydubina/fpmoney