]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Resource/Dispatcher.hs
() should be an instance of Dispatchable.
[Lucu.git] / Network / HTTP / Lucu / Resource / Dispatcher.hs
index ac3112fb9d030cb91330f0d7c2f2d0aa3a103cba..13080ee1da3a0e9fe32bca44152e6375cb774a58 100644 (file)
@@ -38,7 +38,7 @@ instance Dispatchable Dispatcher where
 -- |FIXME: doc
 instance Monoid Dispatcher where
     {-# INLINE mempty #-}
-    mempty = dispatcher (return Nothing ∷ IO (Maybe ResourceDef))
+    mempty = dispatcher ()
 
     {-# INLINEABLE mappend #-}
     mappend (Dispatcher α) (Dispatcher β)
@@ -68,5 +68,10 @@ instance Dispatchable ([ByteString] → Maybe ResourceDef) where
 instance Dispatchable (IO (Maybe ResourceDef)) where
     dispatch = const ∘ const ∘ ((<$>) ∘ (<$>)) ((,) [])
 
+-- |The constant dispatcher returning always the same 'ResourceDef'.
 instance Dispatchable ResourceDef where
     dispatch = const ∘ const ∘ return ∘ Just ∘ (,) []
+
+-- |The empty dispatcher returning always 'Nothing'.
+instance Dispatchable () where
+    dispatch _ _ _ = return Nothing
\ No newline at end of file