]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Resource.hs
Destroy Data.Eq.Indirect
[Lucu.git] / Network / HTTP / Lucu / Resource.hs
index 1abf14be8e6bc7782d47e97bb3ddda75128b8c3b..ce6c98a32c63e99af1d17effeb19eb02b7775b90 100644 (file)
@@ -8,6 +8,7 @@
   , QuasiQuotes
   , RecordWildCards
   , UnicodeSyntax
+  , ViewPatterns
   #-}
 -- |This is the Resource Monad; monadic actions to define a behavior
 -- of resource. The 'Rsrc' Monad is a kind of 'IO' Monad thus it
@@ -623,13 +624,13 @@ getForm limit
 -- \"Location\" header field as @uri@. The @code@ must satisfy
 -- 'isRedirection' or it raises an error.
 redirect ∷ StatusCode sc ⇒ sc → URI → Rsrc ()
-redirect sc uri
-    = do when (sc â\89\88 NotModified ∨ (¬) (isRedirection sc))
+redirect (fromStatusCode → sc) uri
+    = do when (sc â\89¡ cs NotModified ∨ (¬) (isRedirection sc))
              $ abort
              $ mkAbortion' InternalServerError
              $ cs
              $ ("Attempted to redirect with status " ∷ Ascii)
-             ⊕ cs (fromStatusCode sc)
+             ⊕ cs sc
          setStatus sc
          setLocation uri