X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FAbortion.hs;h=091b1bb9a03f8298b56f674959aafd0efda6d947;hp=0a5ed07ff5435913e02beaba0cfbf7a905ed9a50;hb=e53a2f3202f763e844de725712f1bf26b82cd41f;hpb=83db536d11e8efb26848318ad4514b825f412460 diff --git a/Network/HTTP/Lucu/Abortion.hs b/Network/HTTP/Lucu/Abortion.hs index 0a5ed07..091b1bb 100644 --- a/Network/HTTP/Lucu/Abortion.hs +++ b/Network/HTTP/Lucu/Abortion.hs @@ -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