hd :: [a] -> a hd [] = error "empty list" hd (x : _) = x main :: IO () main = print (hd []::[String])