Commit bfa9069b authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Make it compile cleanly on GHC 8.10.7 and GHC 9.4.7

parent 25a1e955
with-compiler: ghc-9.4.7
packages: .
tests: True
...@@ -48,7 +48,7 @@ library ...@@ -48,7 +48,7 @@ library
RecordWildCards RecordWildCards
TypeOperators TypeOperators
build-depends: build-depends:
aeson >= 1.5.6 && < 1.6 aeson >= 1.5.6 && < 2.3
, base >=4.7 && <5 , base >=4.7 && <5
, bytestring >= 0.11.0 && < 0.13 , bytestring >= 0.11.0 && < 0.13
, conduit >= 1.3.5 && < 1.4 , conduit >= 1.3.5 && < 1.4
...@@ -62,8 +62,8 @@ library ...@@ -62,8 +62,8 @@ library
, optparse-applicative >= 0.17 && < 0.19 , optparse-applicative >= 0.17 && < 0.19
, protolude >= 0.3.3 && < 0.4 , protolude >= 0.3.3 && < 0.4
, scientific >= 0.3.7.0 && < 0.4 , scientific >= 0.3.7.0 && < 0.4
, servant >= 0.19 && < 0.21 , servant >= 0.19 && < 0.20
, servant-client >= 0.19 && < 0.21 , servant-client >= 0.19 && < 0.20
, split >= 0.2.3.5 && < 0.3 , split >= 0.2.3.5 && < 0.3
, text >= 1.2.3.0 && < 2.1 , text >= 1.2.3.0 && < 2.1
, text-format >= 0.3.2.1 && < 0.4 , text-format >= 0.3.2.1 && < 0.4
......
module HAL where
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE BangPatterns #-}
module HAL where
import Conduit import Conduit
import Control.Monad import Control.Monad
import Control.Monad.Reader import Control.Monad.Reader
......
...@@ -6,11 +6,13 @@ import Control.Lens qualified as L ...@@ -6,11 +6,13 @@ import Control.Lens qualified as L
import Data.Aeson import Data.Aeson
import Data.Default import Data.Default
import Data.Map.Strict qualified as Map import Data.Map.Strict qualified as Map
import Data.String
import GHC.Generics import GHC.Generics
import HAL.Utils (allLangs, langAbstractS) import HAL.Utils (allLangs, langAbstractS)
import Data.LanguageCodes (ISO639_1(..)) import Data.LanguageCodes (ISO639_1(..))
import Protolude import Protolude
import Servant.API (ToHttpApiData(..)) import Servant.API (ToHttpApiData(..))
import qualified Data.Text as T
data Corpus = Corpus data Corpus = Corpus
{ _corpus_docid :: Text { _corpus_docid :: Text
...@@ -42,7 +44,7 @@ instance FromJSON Corpus where ...@@ -42,7 +44,7 @@ instance FromJSON Corpus where
abstracts <- abstracts <-
mapM (\lang -> do mapM (\lang -> do
ma <- o .:? (langAbstractS lang) ma <- o .:? (fromString $ T.unpack $ langAbstractS lang)
pure $ (\a -> (lang, a)) <$> ma) allLangs pure $ (\a -> (lang, a)) <$> ma) allLangs
let _corpus_abstract_lang_map = Map.fromList $ catMaybes abstracts let _corpus_abstract_lang_map = Map.fromList $ catMaybes abstracts
......
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