url :: B.ByteString -> Request -> Builder
url approot r = "http" <>
    (if isSecure r then "s" else "") <>
    "://" <>
    (byteString $ maybe "" id (requestHeaderHost r)) <>
    (byteString approot) <>
    (byteString $ rawPathInfo r) <>
    (byteString $ rawQueryString r)
url :: B.ByteString -> Request -> Builder
url approot r = "http" <>
    (if isSecure r then "s" else "") <>
    "://" <>
    (byteString $ maybe "" id (requestHeaderHost r)) <>
    (byteString approot) <>
    (byteString $ rawPathInfo r) <>
    (byteString $ rawQueryString r)
url approot r = "http" <>
    (if isSecure r then "s" else "") <>
    "://" <>
    (byteString $ maybe "" id (requestHeaderHost r)) <>
    (byteString approot) <>
    (byteString $ rawPathInfo r) <>
    (byteString $ rawQueryString r)