hsp 0.7.2 → 0.7.3
raw patch · 3 files changed
+30/−23 lines, 3 filesdep −ghcdep −old-exceptiondep ~base
Dependencies removed: ghc, old-exception
Dependency ranges changed: base
Files
- hsp.cabal +9/−16
- src/HSP/Exception.hs +11/−3
- src/HSP/Monad.hs +10/−4
hsp.cabal view
@@ -1,5 +1,5 @@ Name: hsp-Version: 0.7.2+Version: 0.7.3 License: BSD3 License-File: LICENSE Author: Niklas Broberg, Joel Bjornson@@ -18,31 +18,24 @@ * A cgi-handler utility (as a separate package, hsp-cgi) . For details on usage, please see the website, and the author's thesis.-Homepage: http://patch-tag.com/r/nibro/hsp+Homepage: http://hub.darcs.net/nibro/hsp Build-Type: Simple Cabal-Version: >= 1.6 Tested-With: GHC==6.8.3, GHC==6.10, GHC==7.0.2 source-repository head type: darcs- location: http://patch-tag.com/r/nibro/hsp--Flag base4+ location: http://hub.darcs.net/nibro/hsp -Flag ghc76+Flag base46 Library- Build-Depends: base >3 && < 5, mtl, harp, hsx>=0.10.2 && < 0.11, HJScript>=0.6.1, text- if flag(base4)- Build-depends: base >= 4 && < 5- cpp-options: -DBASE4- else- Build-depends: base >= 3 && < 4- if flag(ghc76)- Build-depends: ghc >= 7.6, old-exception- cpp-options: -DGHC76+ Build-Depends: base >4 && < 5, mtl, harp, hsx>=0.10.2 && < 0.11, HJScript>=0.6.1, text+ if flag(base46)+ Build-depends: base >= 4.6 && < 5+ cpp-options: -DBASE46 else- Build-depends: ghc < 7.6+ Build-depends: base >= 4 && < 4.6 Hs-Source-Dirs: src Exposed-Modules: HSP.XML, HSP.XML.PCDATA, HSP.HTML, HSP.Env, HSP.Env.Request, HSP.Env.NumberGen, HSP.HJScript, HSP Other-Modules: HSP.Exception, HSP.Monad, HSP.XMLGenerator
src/HSP/Exception.hs view
@@ -18,10 +18,10 @@ ) where import Data.Typeable-#ifdef BASE4-import Control.OldException (throwDyn)+#ifdef BASE46+import qualified Control.Exception (Exception, throw) #else-import Control.Exception (throwDyn)+import Control.OldException (throwDyn) #endif data Exception = ParameterLookupFailed String -- ^ User tried to do an irrefutable parameter lookup@@ -29,7 +29,15 @@ -- | ... I'm sure there should be more exceptions, we'll add them when we get to them. deriving (Eq, Show, Typeable) +#ifdef BASE46+instance Control.Exception.Exception Exception+#endif+ -- Internal funcion that throws a dynamic exception particular to HSP. throwHSP :: Exception -> a+#ifdef BASE46+throwHSP = Control.Exception.throw+#else throwHSP = throwDyn+#endif
src/HSP/Monad.hs view
@@ -31,10 +31,10 @@ import Prelude hiding (catch) -- Exceptions-#ifdef BASE4-import Control.OldException (catchDyn)+#ifdef BASE46+import qualified Control.Exception (catch) #else-import Control.Exception (catchDyn)+import Control.OldException (catchDyn) #endif import HSP.Exception @@ -116,5 +116,11 @@ -- | Catch a user-caused exception. catch :: HSP a -> (Exception -> HSP a) -> HSP a catch (XMLGenT (RWST f)) handler = XMLGenT $ RWST $ \e s ->- f e s `catchDyn` (\ex -> (let (XMLGenT (RWST g)) = handler ex+ f e s+#ifdef BASE46+ `Control.Exception.catch`+#else+ `catchDyn`+#endif+ (\ex -> (let (XMLGenT (RWST g)) = handler ex in g e s))