]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Abortion.hs
Implemented fallback handler.
[Lucu.git] / Network / HTTP / Lucu / Abortion.hs
index 0a5ed07ff5435913e02beaba0cfbf7a905ed9a50..bc03045b74b1d33ddbabb9adfeb7e2cde340de54 100644 (file)
@@ -5,6 +5,7 @@
 module Network.HTTP.Lucu.Abortion
     ( Abortion(..)
     , abort
+    , abortPurely
     , abortSTM
     , abortA
     , abortPage
@@ -69,6 +70,11 @@ abort status headers msg
       in
         liftIO $ throwIO exc
 
+-- |This is similar to 'abort' but computes it with
+-- 'System.IO.Unsafe.unsafePerformIO'.
+abortPurely :: StatusCode -> [ (ByteString, ByteString) ] -> Maybe String -> a
+abortPurely = ((unsafePerformIO .) .) . abort
+
 -- |Computation of @'abortSTM' status headers msg@ just computes
 -- 'abort' in a 'Control.Monad.STM.STM' monad.
 abortSTM :: StatusCode -> [ (ByteString, ByteString) ] -> Maybe String -> STM a