So I have to make a function that finds a pair with its 1st letter and returning the 2nd letter.
I actually found one answer but with the map function and I couldn\'
It seems that you typed something like this in ghci:
*Main> lookUp 'c'
An expression like lookUp 'c'
is a partial evaluation / curried form of the lookUp
function. It's type is:
*Main> :t lookUp 'c'
lookUp 'c' :: [(Char, Char)] -> Char
which is the exact type that ghci says there is no Show instance for.
To test your function, be sure to supply both x
and the the list of Char
pairs:
*Main> lookUp 'c' [ ('a','A'), ('b','B'), ('c','C') ]
'C'