put (r{reqPath=tail $ reqPath r}, rhs)
    return ∘ head $ reqPath r 
{-# INLINEABLE popPath #-}

-- | Checks that the path stack is empty
emptyPath ∷ Route ()
emptyPath = get >>= guard ∘ null ∘ reqPath ∘ fst
{-# INLINE empt
popPath ∷ Route B.ByteString
popPath = do
    (r, rhs) ← get
    guard ∘ not ∘ null $ reqPath r
    put (r{reqPath=tail $ reqPath r}, rhs)
    return ∘ head $ reqPath r 

popPath = do
    (r, rhs) ← get
    guard ∘ not ∘ null $ reqPath r
    put (r{reqPath=tail $ reqPath r}, rhs)
    return ∘ head $ reqPath r 
