refactor template map to use Text over String

This commit is contained in:
outfoxxed 2025-02-10 22:36:44 -08:00
parent ba38e5e66e
commit 7a7a3b65f8
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 22 additions and 17 deletions

View file

@ -30,9 +30,12 @@ parseMetricsResponse MetricsResponse { results = r } = Map.fromList <$> mapM par
parseResult MRResult { metrics = [count], dimensions = [path] } = Right (removeTrailingSlash path, count)
parseResult result = Left $ "Could not parse result: " ++ show result
removeTrailingSlash "" = ""
removeTrailingSlash "/" = ""
removeTrailingSlash (x:xs) = x : removeTrailingSlash xs
removeTrailingSlash "/" = "/"
removeTrailingSlash xs = removeTrailingSlash' xs
removeTrailingSlash' "" = ""
removeTrailingSlash' "/" = ""
removeTrailingSlash' (x:xs) = x : removeTrailingSlash' xs
queryPageviews :: C.Config -> IO (Either String (Map String Int))
queryPageviews config = do