X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FRouter.hs;h=8624f53aa8312d514f5ca9af0e2fe70366c85f89;hp=657df3bb19cc76ea748edd0c008324a991c0c55c;hb=af68f61;hpb=896da36ec761ae1c66a12350a91ca7c399ab6262 diff --git a/Network/HTTP/Lucu/Router.hs b/Network/HTTP/Lucu/Router.hs index 657df3b..8624f53 100644 --- a/Network/HTTP/Lucu/Router.hs +++ b/Network/HTTP/Lucu/Router.hs @@ -13,7 +13,6 @@ module Network.HTTP.Lucu.Router -- * Testing for URI scheme , anyScheme - , schemeWith , scheme , http , http' @@ -57,22 +56,15 @@ anyScheme ∷ Arrow (⇝) ⇒ URI ⇝ (Host, Path) anyScheme = arr uriHost &&& arr uriPathSegments -- |FIXME: doc -schemeWith ∷ (ArrowChoice (⇝), ArrowZero (⇝)) - ⇒ (CIAscii → Bool) - → URI ⇝ (Host, Path) -{-# INLINEABLE schemeWith #-} -schemeWith f +scheme ∷ (ArrowChoice (⇝), ArrowZero (⇝)) ⇒ CIAscii → URI ⇝ (Host, Path) +{-# INLINEABLE scheme #-} +scheme s = proc uri → - if f (uriCIScheme uri) then + if s ≡ uriCIScheme uri then anyScheme ⤙ uri else zeroArrow ⤙ (⊥) --- |@'scheme' s@ = @'schemeWith' ('==' s)@ -scheme ∷ (ArrowChoice (⇝), ArrowZero (⇝)) ⇒ CIAscii → URI ⇝ (Host, Path) -{-# INLINE scheme #-} -scheme = schemeWith ∘ (≡) - -- |@'http' = 'scheme' \"http\" '<+>' 'scheme' \"https\"@ http ∷ (ArrowChoice (⇝), ArrowPlus (⇝), ArrowZero (⇝)) ⇒ URI ⇝ (Host, Path) {-# INLINE http #-}