Commit 3c80b872 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[CLEAN] cosmetics

parent f64cd01e
...@@ -66,7 +66,6 @@ searchAxv q = ...@@ -66,7 +66,6 @@ searchAxv q =
(Status 200 _) -> getSoup (getResponseBody rsp) >>= results q (Status 200 _) -> getSoup (getResponseBody rsp) >>= results q
st -> error $ "Error:" ++ show st st -> error $ "Error:" ++ show st
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- Consume page by page -- Consume page by page
---------------------------------------------------------------------- ----------------------------------------------------------------------
...@@ -114,16 +113,17 @@ mkResult sp = let doi' = Ax.getDoi sp ...@@ -114,16 +113,17 @@ mkResult sp = let doi' = Ax.getDoi sp
authors' = Ax.getAuthors sp authors' = Ax.getAuthors sp
publication_date'= Ax.getPublished sp publication_date'= Ax.getPublished sp
year' = Ax.getYear sp year' = Ax.getYear sp
title_tmp = Ax.getTitle sp & clean ['\n', '\r', '\t'] title' = Ax.getTitle sp & clean'
title' = if null title_tmp then "No title" else title_tmp abstract' = Ax.getSummary sp & clean'
abstract' = Ax.getSummary sp
in ( Result doi' url' in ( Result doi' url'
primaryCategory' categories' primaryCategory' categories'
journal' authors' journal' authors'
publication_date' year' publication_date' year'
title' abstract' title' abstract'
) )
where clean _ [] = [] where clean' x = let x' = clean ['\n', '\r', '\t'] x
in if null x' then "Not found" else x'
clean _ [] = []
clean d (c:cs) | c `elem` d = " " <> clean d cs clean d (c:cs) | c `elem` d = " " <> clean d cs
| otherwise = c:clean d cs | otherwise = c:clean d cs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment