- $ \host path → do r ← findResource α host path
- case r of
- Just _ → return r
- Nothing → findResource β host path
-
-instance Dispatchable (CI Text
- → [ByteString]
- → IO (Maybe ([ByteString], ResourceDef))) where
- findResource = id
-
-instance Dispatchable (CI Text
- → [ByteString]
- → Maybe ([ByteString], ResourceDef)) where
- findResource = ((return ∘) ∘)
-
-instance Dispatchable (CI Text
- → [ByteString]
- → IO (Maybe ResourceDef)) where
- findResource = ((((<$>) ∘ (<$>)) ((,) []) ∘) ∘)
-
-instance Dispatchable (CI Text
- → [ByteString]
- → Maybe ResourceDef) where
- findResource = (((return ∘ ((,) [] <$>)) ∘) ∘)
-
-instance Dispatchable ([ByteString]
- → IO (Maybe ([ByteString], ResourceDef))) where
- findResource = const
-
-instance Dispatchable ([ByteString]
- → Maybe ([ByteString], ResourceDef)) where
- findResource = const ∘ (return ∘)
-
-instance Dispatchable ([ByteString]
- → IO (Maybe ResourceDef)) where
- findResource = const ∘ (((<$>) ∘ (<$>)) ((,) []) ∘)
+ $ \uri → do r ← dispatch a uri
+ case r of
+ Just _ → return r
+ Nothing → dispatch b uri
+ {-# INLINE empty #-}
+ empty = dispatcher e
+ where
+ e ∷ URI → IO (Maybe Resource)
+ {-# INLINE e #-}
+ e = return ∘ const Nothing
+ {-# INLINE singleton #-}
+ singleton = dispatcher