[Haskell-cafe] Beginner question

Benjamin Bach benjaoming at gmail.com
Fri Jan 2 12:18:49 EST 2009


>>> module Main(main) where
>>>   main = putStr (show [])
>
> What type is your "[]" here?
> (...)
> You may think it's irrelevant, since empty lists are showed the same; but
> they are not: for example, ([] :: [Char]) would be shown as '""' (empty
> string).

Of course you're right. Didn't know how to type an empty list. "main =
putStr (show ([] :: [Char]))" seems so obvious now.

Thanks,
Benjamin


More information about the Haskell-Cafe mailing list