Created
November 2, 2010 02:15
-
-
Save hellertime/659175 to your computer and use it in GitHub Desktop.
Control.Exception.handle is ambiguous in its type, you must provide a type signature for it to type-check.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> import Control.Exception ( handle, IOException ) | |
here is a specialize handle which deals with IOExceptions | |
> handleIO :: (IOException -> IO a) -> IO a -> IO a | |
> handleIO = handle | |
Without this added signature you will get type-check errors like this: | |
Ambiguous type variable `e' in the constraint: | |
`GHC.Exception.Exception e' | |
arising from a use of `handle' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment