From af68f614175a3e760bbf2f59c5cd20de412bbb0c Mon Sep 17 00:00:00 2001 From: PHO Date: Fri, 13 Jan 2012 01:07:09 +0900 Subject: [PATCH] working on Router Ditz-issue: c80e79a2585ac20cc5ed677d70b6983a2842a81d --- Network/HTTP/Lucu/Router.hs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) 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 #-} -- 2.40.0