githubConfig :: APILocation -> Maybe String -> Maybe (Request m)
githubConfig loc mk = do
  req <- parseUrl endpoint
  return $ addTokenHeader req
  where
    endpoint = case loc of
      GitHub -> "https://api.github.com/"
      Enterprise url -> url
    addTokenHeader = case mk of
      Nothing -> id
      Just k -> \req -> req
        { requestHeaders = ("Authorization", append "token " (pack k)) : requestHeaders req
        }
githubConfig :: APILocation -> Maybe String -> Maybe (Request m)
githubConfig loc mk = do
  req <- parseUrl endpoint
  return $ addTokenHeader req
  where
    endpoint = case loc of
      GitHub -> "https://api.github.com/"
      Enterprise url -> url
    addTokenHeader = case mk of
      Nothing -> id
      Just k -> \req -> req
        { requestHeaders = ("Authorization", append "token " (pack k)) : requestHeaders req
        }
githubConfig loc mk = do
  req <- parseUrl endpoint
  return $ addTokenHeader req
  where
    endpoint = case loc of
      GitHub -> "https://api.github.com/"
      Enterprise url -> url
    addTokenHeader = case mk of
      Nothing -> id
      Just k -> \req -> req
        { requestHeaders = ("Authorization", append "token " (pack k)) : requestHeaders req
        }