Suggestion: Syntactic sugar for Maps!
John Meacham
john at repetae.net
Thu Nov 27 19:20:53 EST 2008
On Thu, Nov 27, 2008 at 07:59:08PM +0100, circ ular wrote:
> I suggest Haskell introduce some syntactic sugar for Maps.
>
> Python uses {"this": 2, "is": 1, "a": 1, "Map": 1}
>
> Clojure also use braces: {:k1 1 :k2 3} where whitespace is comma but
> commas are also allowed.
>
> I find the import Data.Map and then fromList [("hello",1), ("there",
> 2)] or the other form that I forgot(because it is to long!) to be to
> long...
>
> So why not {"hello": 1, "there": 2} ?
it is hard to see much benefit over something like this:
x ==> y = (x,y)
myMap = fromList [
"hello" ==> 1,
"there" ==> 2
]
John
--
John Meacham - ⑆repetae.net⑆john⑈
More information about the Haskell-prime
mailing list