]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Abortion.hs
multipart/form-data and more
[Lucu.git] / Network / HTTP / Lucu / Abortion.hs
index 0a5ed07ff5435913e02beaba0cfbf7a905ed9a50..091b1bb9a03f8298b56f674959aafd0efda6d947 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 compute 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