From 15c2e705b1460e0617bdebbec6a6267e786a324d Mon Sep 17 00:00:00 2001 From: Norbert Litkowski Date: Wed, 7 Apr 2021 12:43:50 +0200 Subject: [PATCH] Add lens regex package --- app/ZborBielawa.hs | 3 ++- shadow-library.cabal | 1 + stack.yaml | 8 ++++++-- stack.yaml.lock | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/ZborBielawa.hs b/app/ZborBielawa.hs index 1911d3d..aba319b 100644 --- a/app/ZborBielawa.hs +++ b/app/ZborBielawa.hs @@ -11,6 +11,7 @@ import Data.List.Utils (replace) import Text.Regex.Posix import Text.Printf +import Control.Lens.Regex.Text getLinkAndText xpathCondition = proc doc -> do xpathTrees <- getXPathTrees xpathCondition -< doc @@ -42,7 +43,7 @@ toShadowItem (((url, releaseTitle), collectionTitle), categoryTitle) = itype = "periodical", format = Just "pdf", finalUrl = url - } + } where title = categoryTitle ++ (" " ++ collectionTitle) date = getDate $ releaseTitle diff --git a/shadow-library.cabal b/shadow-library.cabal index dda3c81..13a903a 100644 --- a/shadow-library.cabal +++ b/shadow-library.cabal @@ -70,6 +70,7 @@ executable zborbielawa , MissingH , regex-posix , shadow-library + , lens-regex-pcre default-language: Haskell2010 diff --git a/stack.yaml b/stack.yaml index 6c16955..75988a7 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,5 +1,9 @@ flags: {} packages: - '.' -extra-deps: [hxt-xpath-9.1.2.2] -resolver: lts-11.9 +extra-deps: [ + hxt-xpath-9.1.2.2, + lens-regex-pcre-1.1.0.0, + pcre-light-0.4.1.0 +] +resolver: lts-11.9 \ No newline at end of file diff --git a/stack.yaml.lock b/stack.yaml.lock index cc80ef3..690a975 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -11,6 +11,20 @@ packages: sha256: aee2f75974e868ff429b8ff349a29667536c60397098f5dfedc968d1951511bb original: hackage: hxt-xpath-9.1.2.2 +- completed: + hackage: lens-regex-pcre-1.1.0.0@sha256:a6053fefae59f6b53b4741e5a75c5fae350af80dbf62e8673b565e1c3f34f8b9,2209 + pantry-tree: + size: 630 + sha256: 84a02d84433d92c5e2a9a7bfd662244be607b4004c7d4d6fd1ba53adbc655022 + original: + hackage: lens-regex-pcre-1.1.0.0 +- completed: + hackage: pcre-light-0.4.1.0@sha256:4902ef06b037fd79448c7a63a65c1a4a1bf0bbc15ea7e67e71d52ec995e18460,1868 + pantry-tree: + size: 467 + sha256: 5e5f8d948ba577d4d838895ccb3533c6ef9876ef60884dae8342a77934cc2ec2 + original: + hackage: pcre-light-0.4.1.0 snapshots: - completed: size: 507596