summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-06-19 11:04:10 -0400
committerAndrew Cady <d@jerkface.net>2023-06-19 11:04:10 -0400
commit9c1bd9b72a3167dd988bba9a51d381394ef3cd05 (patch)
tree49c2a011e57956edd91fc7443e04e40bf73b5117
parentdcd1b899cef238c77c9a3169017dfaa5e7b7f4e3 (diff)
forward port to stackage lts-20.25
-rw-r--r--fsmgr.cabal2
-rw-r--r--src/Crypto/Hash/Types/Digest/Read.hs20
-rw-r--r--stack.yaml4
3 files changed, 3 insertions, 23 deletions
diff --git a/fsmgr.cabal b/fsmgr.cabal
index 4d2de80..6ad9040 100644
--- a/fsmgr.cabal
+++ b/fsmgr.cabal
@@ -19,7 +19,7 @@ source-repository head
19 19
20library 20library
21 exposed-modules: 21 exposed-modules:
22 Crypto.Hash.Types.Digest.Read, ConfigFile, String 22 ConfigFile, String
23 other-modules: 23 other-modules:
24 Paths_fsmgr 24 Paths_fsmgr
25 hs-source-dirs: 25 hs-source-dirs:
diff --git a/src/Crypto/Hash/Types/Digest/Read.hs b/src/Crypto/Hash/Types/Digest/Read.hs
deleted file mode 100644
index f371f30..0000000
--- a/src/Crypto/Hash/Types/Digest/Read.hs
+++ /dev/null
@@ -1,20 +0,0 @@
1{-# OPTIONS_GHC -fno-warn-orphans #-}
2{-# LANGUAGE InstanceSigs #-}
3{-# LANGUAGE NoImplicitPrelude #-}
4{-# LANGUAGE PartialTypeSignatures #-}
5{-# LANGUAGE ViewPatterns #-}
6module Crypto.Hash.Types.Digest.Read where
7import Rebase.Prelude hiding (hash)
8
9import Crypto.Hash
10import Data.ByteArray.Encoding
11import qualified Rebase.Data.Text as Text
12
13instance HashAlgorithm a =>
14 Read (Digest a) where
15 readsPrec :: Int -> (String -> [(Digest a, String)])
16 readsPrec _ (Text.encodeUtf8 . Text.pack -> bytes) =
17 toList $ (flip (,) "") <$> (digestFromByteString =<< baseConv bytes)
18 where
19 baseConv :: ByteString -> Maybe (ByteString)
20 baseConv = listToMaybe . toList . convertFromBase Base16
diff --git a/stack.yaml b/stack.yaml
index 4dd153e..e479311 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,8 +1,8 @@
1resolver: lts-13.26 1resolver: lts-20.25
2# build: 2# build:
3# library-profiling: true 3# library-profiling: true
4# executable-profiling: true 4# executable-profiling: true
5packages: 5packages:
6- . 6- .
7extra-deps: 7extra-deps:
8- yaml-combinators-1.1.1.1 8- yaml-combinators-1.1.2.1