-- * Testing for URI scheme
, anyScheme
- , schemeWith
, scheme
, http
, http'
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 #-}