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

[TYPES] adding ArxivDocument type

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