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

[CLEAN] cosmetics

parent f64cd01e
......@@ -66,7 +66,6 @@ searchAxv q =
(Status 200 _) -> getSoup (getResponseBody rsp) >>= results q
st -> error $ "Error:" ++ show st
----------------------------------------------------------------------
-- Consume page by page
----------------------------------------------------------------------
......@@ -114,16 +113,17 @@ mkResult sp = let doi' = Ax.getDoi sp
authors' = Ax.getAuthors sp
publication_date'= Ax.getPublished sp
year' = Ax.getYear sp
title_tmp = Ax.getTitle sp & clean ['\n', '\r', '\t']
title' = if null title_tmp then "No title" else title_tmp
abstract' = Ax.getSummary sp
title' = Ax.getTitle sp & clean'
abstract' = Ax.getSummary sp & clean'
in ( Result doi' url'
primaryCategory' categories'
journal' authors'
publication_date' year'
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
| 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