From: PHO Date: Thu, 12 Jan 2012 16:07:09 +0000 (+0900) Subject: working on Router X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=af68f61;p=Lucu.git working on Router Ditz-issue: c80e79a2585ac20cc5ed677d70b6983a2842a81d --- 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 #-}