What is the difference between IO (a) and IO a in Haskell?
For instance:
IO (String)
vs IO String
IO (Int)
vs IO Int
Most books I've seen wrap a type in parentheses before putting it after IO, but it's not obvious to me whether these are the same thing or not.
(map)
or(Int)
, in any expression or type context -- they are redundant and only add noise. Parentheses are still needed in(+) x y
,f (g x)
,IO (Maybe Bool)
, for example. In(f x) + (g y)
they are also redundant, but sometimes they can (arguably) add clarity. Still, there is no point in writing(x)
-- you should avoid it. I'd hope books do not do that.