Prelude> import Data.HList
Prelude Data.HList> let myList = False .*. 'c' .*. HNil
Prelude Data.HList> myList
H[False,'c']
Prelude Data.HList> :t myList
myList :: HList '[Bool, Char]
Now,
Prelude Data.HList> hMap show myList
<interactive>:5:1: error:
* Couldn't match type `Bool' with `Char'
arising from a use of `hMap'
* In the expression: hMap show myList
In an equation for `it': it = hMap show myList
I would expect to have H["False","'c'"] of type H[String,String]
I understand that the show function is indeed not the same instance for the type Bool and the type Char , but I don't get the point of this HList if such operation is impossible.
How to operate generically with function part of the instances that those types share instanciation ?