[Haskell-beginners] type ambiguity confusion
stephen.tetley at gmail.com
Tue Jun 15 10:07:38 EDT 2010
On 15 June 2010 14:57, Thomas <haskell at phirho.com> wrote:
> However: Why does the ambiguity matter in the first place?
> The corresponding value is never used (\_ -> return Nothing).
GHC has to resolve all types, even if they are for values that are not
used at runtime.
> And there's another doubt: I got this example from a book (Real World
> Haskell, chapter 9) where actually the first version is used, without
> resolving the ambiguity in any way. And it does not show up in the errata
> So there's likely something I'm still missing about this issue?!?!
The type of handle in Control.Exception has (probably) changed since
RWH was written.
latest (from ghc-6.10.1 onwards):
handle :: Exception e => (e -> IO a) -> IO a -> IO a
old (upto ghc-6.8.3, I think, the so called Old.Exception):
handle :: (Exception -> IO a) -> IO a -> IO a
More information about the Beginners