Commit 5df9762f authored by Mael NICOLAS's avatar Mael NICOLAS

[WIP] Add asc & desc to simplify writting

parent c72b9184
......@@ -12,7 +12,7 @@ main :: IO ()
main = do
manager' <- newManager tlsManagerSettings
res <- runClientM
(search ["docid"] . Just $ Desc "docid")
(search ["docid"] (asc "docid"))
(mkClientEnv manager' $ BaseUrl Https "api.archives-ouvertes.fr" 443 "")
case res of
(Left err) -> print err
......
......@@ -29,6 +29,12 @@ instance ToHttpApiData SortField where
toUrlPiece (Asc t) = t <> " asc"
toUrlPiece (Desc t) = t <> " desc"
asc :: Text -> Maybe SortField
asc = Just . Asc
desc :: Text -> Maybe SortField
desc = Just . Desc
-- Response type
data Response = Response
{
......
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