Migrate to GHC 9.0
This commit is contained in:
parent
7319169075
commit
9e2b767d8d
10
espial.cabal
10
espial.cabal
|
@ -1,6 +1,6 @@
|
||||||
cabal-version: 1.12
|
cabal-version: 1.12
|
||||||
|
|
||||||
-- This file has been generated from package.yaml by hpack version 0.34.4.
|
-- This file has been generated from package.yaml by hpack version 0.34.7.
|
||||||
--
|
--
|
||||||
-- see: https://github.com/sol/hpack
|
-- see: https://github.com/sol/hpack
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ library
|
||||||
, vector
|
, vector
|
||||||
, wai
|
, wai
|
||||||
, wai-extra >=3.0 && <3.2
|
, wai-extra >=3.0 && <3.2
|
||||||
, wai-logger >=2.2 && <2.4
|
, wai-logger
|
||||||
, warp >=3.0 && <3.4
|
, warp >=3.0 && <3.4
|
||||||
, yaml >=0.8 && <0.12
|
, yaml >=0.8 && <0.12
|
||||||
, yesod >=1.6 && <1.8
|
, yesod >=1.6 && <1.8
|
||||||
|
@ -322,7 +322,7 @@ executable espial
|
||||||
, vector
|
, vector
|
||||||
, wai
|
, wai
|
||||||
, wai-extra >=3.0 && <3.2
|
, wai-extra >=3.0 && <3.2
|
||||||
, wai-logger >=2.2 && <2.4
|
, wai-logger
|
||||||
, warp >=3.0 && <3.4
|
, warp >=3.0 && <3.4
|
||||||
, yaml >=0.8 && <0.12
|
, yaml >=0.8 && <0.12
|
||||||
, yesod >=1.6 && <1.8
|
, yesod >=1.6 && <1.8
|
||||||
|
@ -433,7 +433,7 @@ executable migration
|
||||||
, vector
|
, vector
|
||||||
, wai
|
, wai
|
||||||
, wai-extra >=3.0 && <3.2
|
, wai-extra >=3.0 && <3.2
|
||||||
, wai-logger >=2.2 && <2.4
|
, wai-logger
|
||||||
, warp >=3.0 && <3.4
|
, warp >=3.0 && <3.4
|
||||||
, yaml >=0.8 && <0.12
|
, yaml >=0.8 && <0.12
|
||||||
, yesod >=1.6 && <1.8
|
, yesod >=1.6 && <1.8
|
||||||
|
@ -547,7 +547,7 @@ test-suite test
|
||||||
, vector
|
, vector
|
||||||
, wai
|
, wai
|
||||||
, wai-extra >=3.0 && <3.2
|
, wai-extra >=3.0 && <3.2
|
||||||
, wai-logger >=2.2 && <2.4
|
, wai-logger
|
||||||
, warp >=3.0 && <3.4
|
, warp >=3.0 && <3.4
|
||||||
, yaml >=0.8 && <0.12
|
, yaml >=0.8 && <0.12
|
||||||
, yesod >=1.6 && <1.8
|
, yesod >=1.6 && <1.8
|
||||||
|
|
|
@ -112,7 +112,7 @@ dependencies:
|
||||||
- conduit >=1.0 && <2.0
|
- conduit >=1.0 && <2.0
|
||||||
- monad-logger >=0.3 && <0.4
|
- monad-logger >=0.3 && <0.4
|
||||||
- fast-logger >=2.2 && <4
|
- fast-logger >=2.2 && <4
|
||||||
- wai-logger >=2.2 && <2.4
|
- wai-logger
|
||||||
- file-embed
|
- file-embed
|
||||||
- safe
|
- safe
|
||||||
- unordered-containers
|
- unordered-containers
|
||||||
|
|
|
@ -221,6 +221,7 @@ dbAuthPluginName = "db"
|
||||||
dbAuthPlugin :: AuthPlugin App
|
dbAuthPlugin :: AuthPlugin App
|
||||||
dbAuthPlugin = AuthPlugin dbAuthPluginName dbDispatch dbLoginHandler
|
dbAuthPlugin = AuthPlugin dbAuthPluginName dbDispatch dbLoginHandler
|
||||||
where
|
where
|
||||||
|
dbDispatch :: Text -> [Text] -> AuthHandler App TypedContent
|
||||||
dbDispatch "POST" ["login"] = dbPostLoginR >>= sendResponse
|
dbDispatch "POST" ["login"] = dbPostLoginR >>= sendResponse
|
||||||
dbDispatch _ _ = notFound
|
dbDispatch _ _ = notFound
|
||||||
dbLoginHandler toParent = do
|
dbLoginHandler toParent = do
|
||||||
|
@ -259,7 +260,7 @@ authenticateCreds Creds {..} = do
|
||||||
muser <-
|
muser <-
|
||||||
case credsPlugin of
|
case credsPlugin of
|
||||||
p | p == dbAuthPluginName -> liftHandler $ runDB $
|
p | p == dbAuthPluginName -> liftHandler $ runDB $
|
||||||
join <$> mapM (authenticatePassword credsIdent) (lookup "password" credsExtra)
|
join <$> mapM (\pwd -> authenticatePassword credsIdent pwd) (lookup "password" credsExtra)
|
||||||
_ -> pure Nothing
|
_ -> pure Nothing
|
||||||
case muser of
|
case muser of
|
||||||
Nothing -> pure (UserError InvalidUsernamePass)
|
Nothing -> pure (UserError InvalidUsernamePass)
|
||||||
|
|
|
@ -50,7 +50,7 @@ archiveBookmarkUrl kbid url =
|
||||||
manager <- getArchiveManager
|
manager <- getArchiveManager
|
||||||
res <- liftIO $ NH.httpLbs req manager
|
res <- liftIO $ NH.httpLbs req manager
|
||||||
let status = NH.responseStatus res
|
let status = NH.responseStatus res
|
||||||
let updateArchiveUrl = runDB . updateBookmarkArchiveUrl userId kbid . Just
|
let updateArchiveUrl url' = runDB $ updateBookmarkArchiveUrl userId kbid $ Just url'
|
||||||
headers = NH.responseHeaders res
|
headers = NH.responseHeaders res
|
||||||
case status of
|
case status of
|
||||||
s | s == NH.status200 ->
|
s | s == NH.status200 ->
|
||||||
|
|
|
@ -6,6 +6,7 @@ module Model where
|
||||||
import qualified ClassyPrelude.Yesod as CP
|
import qualified ClassyPrelude.Yesod as CP
|
||||||
import qualified Control.Monad.Combinators as PC (between)
|
import qualified Control.Monad.Combinators as PC (between)
|
||||||
import qualified Data.Aeson as A
|
import qualified Data.Aeson as A
|
||||||
|
import qualified Data.Aeson.KeyMap as KM
|
||||||
import qualified Data.Aeson.Types as A (parseFail)
|
import qualified Data.Aeson.Types as A (parseFail)
|
||||||
import qualified Data.Attoparsec.Text as P
|
import qualified Data.Attoparsec.Text as P
|
||||||
import qualified Data.Time as TI (ParseTime)
|
import qualified Data.Time as TI (ParseTime)
|
||||||
|
@ -488,7 +489,7 @@ isExpanded TagCloudModeNone = False
|
||||||
|
|
||||||
instance FromJSON TagCloudMode where
|
instance FromJSON TagCloudMode where
|
||||||
parseJSON (Object o) =
|
parseJSON (Object o) =
|
||||||
case lookup "mode" o of
|
case KM.lookup "mode" o of
|
||||||
Just (String "top") -> TagCloudModeTop <$> o .: "expanded" <*> o .: "value"
|
Just (String "top") -> TagCloudModeTop <$> o .: "expanded" <*> o .: "value"
|
||||||
Just (String "lowerBound") -> TagCloudModeLowerBound <$> o .: "expanded" <*> o .: "value"
|
Just (String "lowerBound") -> TagCloudModeLowerBound <$> o .: "expanded" <*> o .: "value"
|
||||||
Just (String "related") -> TagCloudModeRelated <$> o .: "expanded" <*> fmap words (o .: "value")
|
Just (String "related") -> TagCloudModeRelated <$> o .: "expanded" <*> fmap words (o .: "value")
|
||||||
|
|
12
stack.yaml
12
stack.yaml
|
@ -1,11 +1,3 @@
|
||||||
resolver: lts-18.8
|
resolver: lts-19.4
|
||||||
# allow-newer: true
|
|
||||||
packages:
|
packages:
|
||||||
- '.'
|
- .
|
||||||
extra-deps:
|
|
||||||
# - ekg-0.4.0.15
|
|
||||||
# - ekg-json-0.1.0.6
|
|
||||||
# - monad-metrics-0.2.1.4
|
|
||||||
# - wai-middleware-metrics-0.2.4
|
|
||||||
- classy-prelude-yesod-1.5.0@sha256:8f7e183bdfd6d2ea9674284c4f285294ab086aff60d9be4e5d7d2f3c1a2b05b7,1330
|
|
||||||
- yesod-newsfeed-1.7.0.0
|
|
||||||
|
|
|
@ -3,24 +3,10 @@
|
||||||
# For more information, please see the documentation at:
|
# For more information, please see the documentation at:
|
||||||
# https://docs.haskellstack.org/en/stable/lock_files
|
# https://docs.haskellstack.org/en/stable/lock_files
|
||||||
|
|
||||||
packages:
|
packages: []
|
||||||
- completed:
|
|
||||||
hackage: classy-prelude-yesod-1.5.0@sha256:8f7e183bdfd6d2ea9674284c4f285294ab086aff60d9be4e5d7d2f3c1a2b05b7,1330
|
|
||||||
pantry-tree:
|
|
||||||
size: 330
|
|
||||||
sha256: ae84d4cc0e1daf985db6cdcf2ac92319531b8e60f547183cc46480d00aafbe20
|
|
||||||
original:
|
|
||||||
hackage: classy-prelude-yesod-1.5.0@sha256:8f7e183bdfd6d2ea9674284c4f285294ab086aff60d9be4e5d7d2f3c1a2b05b7,1330
|
|
||||||
- completed:
|
|
||||||
hackage: yesod-newsfeed-1.7.0.0@sha256:ba49f9af47fe96c521ed889bf041c559b4bddb60a81f385449f7557f8f4aaef2,1345
|
|
||||||
pantry-tree:
|
|
||||||
size: 488
|
|
||||||
sha256: 96027436cc6dc07bca3f691f2d17a5b3993e980f73076c7b1b4d9c5c3ac5cb86
|
|
||||||
original:
|
|
||||||
hackage: yesod-newsfeed-1.7.0.0
|
|
||||||
snapshots:
|
snapshots:
|
||||||
- completed:
|
- completed:
|
||||||
size: 587126
|
size: 618683
|
||||||
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/8.yaml
|
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/4.yaml
|
||||||
sha256: 93a107557e8691ed5ca17beaee41e68222b142c48868fc8c04a4181fb233477d
|
sha256: d4ee004c46ba878d2f304f5d748d493057be579192a8d148527f3ba55c9df57f
|
||||||
original: lts-18.8
|
original: lts-19.4
|
||||||
|
|
Loading…
Reference in a new issue