parseWebsocket :: T.Text -> (S.HostName, String)
parseWebsocket url =
  let
    parsed = do
      uri  <- URI.parseURI $ T.unpack url
      name <- URI.uriRegName <$> URI.uriAuthority uri
      return (name, URI.uriPath uri)
  in case parsed of
    Just (name, path) -> (name, path)
    _                 -> error $ "Couldn't parse Slack websocket URL from " ++ T.unpack url
parseWebsocket :: T.Text -> (S.HostName, String)
parseWebsocket url =
  let
    parsed = do
      uri  <- URI.parseURI $ T.unpack url
      name <- URI.uriRegName <$> URI.uriAuthority uri
      return (name, URI.uriPath uri)
  in case parsed of
    Just (name, path) -> (name, path)
    _                 -> error $ "Couldn't parse Slack websocket URL from " ++ T.unpack url
parseWebsocket url =
  let
    parsed = do
      uri  <- URI.parseURI $ T.unpack url
      name <- URI.uriRegName <$> URI.uriAuthority uri
      return (name, URI.uriPath uri)
  in case parsed of
    Just (name, path) -> (name, path)
    _                 -> error $ "Couldn't parse Slack websocket URL from " ++ T.unpack url