Lists

"Why does [True, 4, "cat"] give a type error?"

All elements of a list in Haskell must have the same type. This doesn't apply to tuples, like (True, 4, "cat"), which will work.


Last update: January 12, 2023
Created: January 8, 2023

Comments