X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FIO%2FError.hs;h=d18a7c5b62da469ab46066119f4f04470c086544;hb=9fa9bc17072a58c0bae2cce4764d38677e96ac29;hp=22becfb7eeb93f67aca50bf38c7fe124ddcbc04d;hpb=7de50399a42ee49b0473b7b6eea2b44a2f941a12;p=ghc-base.git diff --git a/System/IO/Error.hs b/System/IO/Error.hs index 22becfb..d18a7c5 100644 --- a/System/IO/Error.hs +++ b/System/IO/Error.hs @@ -1,7 +1,7 @@ {-# OPTIONS -fno-implicit-prelude #-} ----------------------------------------------------------------------------- --- +-- | -- Module : System.IO.Error -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/core/LICENSE) @@ -10,7 +10,7 @@ -- Stability : provisional -- Portability : portable -- --- $Id: Error.hs,v 1.1 2002/02/05 17:32:27 simonmar Exp $ +-- $Id: Error.hs,v 1.4 2002/04/24 16:31:45 simonmar Exp $ -- -- Standard IO Errors. -- @@ -117,6 +117,10 @@ userErrorType = UserError -- ----------------------------------------------------------------------------- -- IOErrorType predicates +isAlreadyExistsErrorType, isDoesNotExistErrorType, isAlreadyInUseErrorType, + isFullErrorType, isEOFErrorType, isIllegalOperationErrorType, + isPermissionErrorType, isUserErrorType :: IOErrorType -> Bool + #ifdef __GLASGOW_HASKELL__ isAlreadyExistsErrorType AlreadyExists = True isAlreadyExistsErrorType _ = False @@ -148,12 +152,12 @@ isUserErrorType _ = False #ifdef __GLASGOW_HASKELL__ ioeGetErrorType :: IOError -> IOErrorType -ioeGetFileName :: IOError -> Maybe FilePath -ioeGetErrorString :: IOError -> String ioeGetHandle :: IOError -> Maybe Handle +ioeGetErrorString :: IOError -> String +ioeGetFileName :: IOError -> Maybe FilePath ioeGetErrorType (IOException ioe) = ioe_type ioe -ioeGetHandle _ = error "System.IO.Error.ioeGetHandle: not an IO error" +ioeGetErrorType _ = error "System.IO.Error.ioeGetHandle: not an IO error" ioeGetHandle (IOException ioe) = ioe_handle ioe ioeGetHandle _ = error "System.IO.Error.ioeGetHandle: not an IO error"