Commit 91bce820 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[TYPES] adding ArxivDocument type

parent 260dc8be
......@@ -4,17 +4,17 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 9b54afba258889accc35eff3ef449f2a043a780cfc51c974c3e2b0c7768d3bb8
-- hash: 4117de9e11172de2f2e05b5376a7917e5f32b501a9e1d8834ce2c0ff93e586d3
name: arxiv-api
version: 0.1.0.0
description: Please see the README on GitHub at <https://github.com/githubuser/arxiv#readme>
homepage: https://github.com/githubuser/arxiv#readme
bug-reports: https://github.com/githubuser/arxiv/issues
author: Author name here
maintainer: example@example.com
copyright: 2021 Author name here
license: BSD3
homepage: https://github.com/#readme
bug-reports: https://github.com//issues
author: Alexandre Delanoë
maintainer: alexandre+dev@delanoe.org
copyright: 2021 CNRS/A. Delanoë
license: GPLv3
license-file: LICENSE
build-type: Simple
extra-source-files:
......@@ -23,7 +23,7 @@ extra-source-files:
source-repository head
type: git
location: https://github.com/githubuser/arxiv
location: https://github.com/
library
exposed-modules:
......@@ -43,6 +43,7 @@ library
, network
, resourcet
, tagsoup
, text
default-language: Haskell2010
executable arxiv-exe
......@@ -63,6 +64,7 @@ executable arxiv-exe
, network
, resourcet
, tagsoup
, text
default-language: Haskell2010
test-suite arxiv-test
......@@ -84,4 +86,5 @@ test-suite arxiv-test
, network
, resourcet
, tagsoup
, text
default-language: Haskell2010
......@@ -23,16 +23,17 @@ extra-source-files:
description: Please see the README on GitHub at <https://github.com/githubuser/arxiv#readme>
dependencies:
- base >= 4.7 && < 5
- arxiv
- network
- http-conduit
- tagsoup
- base >= 4.7 && < 5
- bytestring
- conduit
- http-conduit
- http-types
- mtl
- network
- resourcet
- http-types
- bytestring
- tagsoup
- text
library:
source-dirs: src
......
module Lib where
import Data.Text (Text)
import qualified Network.Api.Arxiv as Ax
import Network.Api.Arxiv (Expression(..),
Field(..), (/*/), (/+/))
......@@ -19,6 +20,21 @@ import Control.Monad.Trans (liftIO)
import Control.Monad.Trans.Resource (MonadResource)
import Control.Applicative ((<$>))
data ArxivDocument =
ArxivDocument { title :: Text
, date_update :: Text
, date_published :: Text
, date_year :: Text
, summary :: Text
, comment :: Text
, journal :: Text
, doi :: Text
-- , links :: [Link]
, pdfLink :: Maybe Text
}
search :: IO ()
search = withSocketsDo (execQuery makeQuery)
......@@ -28,8 +44,9 @@ makeQuery =
t1 = Exp $ Ti ["quantum"]
t2 = Exp $ Ti ["complexity"]
x = au /*/ (t1 /+/ t2)
x' = Exp (Abs ["clustering"]) /*/ Exp (Abs ["louvain"])
in Ax.Query {
Ax.qExp = Just x,
Ax.qExp = Just x',
Ax.qIds = [],
Ax.qStart = 0,
Ax.qItems = 25}
......
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