]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Abortion.hs
Headers is now instances of collections-api's type classes.
[Lucu.git] / Network / HTTP / Lucu / Abortion.hs
index 064a97ebd8671232b9053a6382d93c85927df318..7b69fb53ae95460d6e6d970b47db4094689cbee2 100644 (file)
@@ -1,5 +1,6 @@
 {-# LANGUAGE
-    UnicodeSyntax
+    FlexibleContexts
+  , UnicodeSyntax
   #-}
 -- |Aborting the computation of 'Network.HTTP.Lucu.Resource.Resource'
 -- in any 'Prelude.IO' monads or arrows.
@@ -14,21 +15,25 @@ module Network.HTTP.Lucu.Abortion
 import Control.Exception
 import Control.Monad.Trans
 import Data.Ascii (Ascii, CIAscii)
+import Data.Collections
 import Data.Monoid.Unicode
 import Data.Text (Text)
 import Network.HTTP.Lucu.Abortion.Internal
-import Network.HTTP.Lucu.Headers
 import Network.HTTP.Lucu.Response
 import Prelude.Unicode
 
 -- |Construct an 'Abortion' with additional headers and an optional
 -- message text.
-mkAbortion ∷ StatusCode sc ⇒ sc → [(CIAscii, Ascii)] → Maybe Text → Abortion
+mkAbortion ∷ (StatusCode sc, Foldable f (CIAscii, Ascii))
+           ⇒ sc
+           → f
+           → Maybe Text
+           → Abortion
 {-# INLINE mkAbortion #-}
-mkAbortion sc hdr msg
+mkAbortion sc hdrs msg
     = Abortion {
         aboStatus  = fromStatusCode sc
-      , aboHeaders = toHeaders hdr
+      , aboHeaders = fromFoldable hdrs
       , aboMessage = msg
       }