[Haskell-cafe] Re: Keys and Maps [Was: Re: I just don't get it
(data structures and OO)]
Albert Y. C. Lai
trebla at vex.net
Thu Jun 7 18:15:22 EDT 2007
Justin Bailey wrote:
> On 6/7/07, Grzegorz <grzegorz.chrupala at computing.dcu.ie> wrote:
>>
>> All this hard work for something that in a lesser language would be the
>> unimpressive: universe["Milky Way"]["Sun"] ;-P
>
> Well, if you want to get picky there is the '!' operator defined in
> Data.Map:
>> universe ! "Milky Way" ! "Sun"
I second that. I particularly like the elimination of ]'s. We certainly
need some symbol to separate the map and the key; but we do really need
to also mark "here be the end of the key"?
(Evidently, this carries over to array indexing and function application
too, i.e., a!!i vs a[i], f$x or f x vs f(x).)
More information about the Haskell-Cafe
mailing list