Immutable dictionaries in Haskell You need to implement immutable dictionaries using only functions without any other data types (custom or built-in).
The dictionary must be indexed by any data type of class Eq and contain values of arbitrary type, but all the values in a dictionary should be of the same type.

Here are some examples of usage:

dict `access` True -- returns value of key True
dict `access` "y"  -- returns value of key "y"
(update "x" 10 dict) `access` "x" -- returns 10 for any dict
update key1 value obj = \key2 -&gt; if key2 == key1 then value else obj key2
access = id


Given the above definitions, your examples should work. Also, you can define an empty dictionary as const x where x is the default value for keys not in the dictionary.