Comparison of programming languages (associative array): Difference between revisions

Content deleted Content added
Go: copy edting, etc.
Haskell: copy editing and linking
Line 469:
</syntaxhighlight>
 
=== [[Haskell (programming language)|Haskell]] ===
The [[Haskell (programming language's)|Haskell]] reportprogramming onlylanguage provides only one kind of associative container: a list of pairs:
 
<syntaxhighlight lang="Haskell">
Line 480:
Just "555-1212"
 
Note that the lookup function returns a "Maybe" value, which is "Nothing" if not found, or "Just ''result{{'' "}} when found.
 
[[Glasgow Haskell Compiler|GHC]], the most commonly used implementation of Haskell, provides two more types of associative containers. Other implementations might also provide these.
Line 515:
Just "555-1212"
 
Lists of pairs and functional maps both provide a purely functional interface, which is more idiomatic in Haskell. In contrast, hash tables provide an imperative interface in the [[Monad_(functional_programming)#IO_monad|IO monad]].
 
=== [[Java (programming language)|Java]] ===