Skip to content

Commit f3f0193

Browse files
committed
Hash: Make warning-clean and reduce language extensions.
1 parent a8aaa9b commit f3f0193

File tree

1 file changed

+4
-13
lines changed
  • hnix-store-core/src/System/Nix/Internal

1 file changed

+4
-13
lines changed

hnix-store-core/src/System/Nix/Internal/Hash.hs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@ Description : Cryptographic hashing interface for hnix-store, on top
33
of the cryptohash family of libraries.
44
-}
55
{-# LANGUAGE AllowAmbiguousTypes #-}
6-
{-# LANGUAGE DataKinds #-}
76
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
8-
{-# LANGUAGE PolyKinds #-}
9-
{-# LANGUAGE RankNTypes #-}
107
{-# LANGUAGE TypeFamilies #-}
11-
{-# LANGUAGE KindSignatures #-}
128
{-# LANGUAGE ScopedTypeVariables #-}
139
{-# LANGUAGE TypeApplications #-}
14-
{-# LANGUAGE TypeInType #-}
10+
{-# LANGUAGE DataKinds #-}
1511
{-# LANGUAGE OverloadedStrings #-}
1612

1713
module System.Nix.Internal.Hash where
@@ -21,21 +17,16 @@ import qualified Crypto.Hash.SHA1 as SHA1
2117
import qualified Crypto.Hash.SHA256 as SHA256
2218
import qualified Data.ByteString as BS
2319
import qualified Data.ByteString.Base16 as Base16
24-
import qualified Data.ByteString.Char8 as BSC
2520
import Data.Bits (xor)
26-
import qualified Data.ByteString as BS
2721
import qualified Data.ByteString.Lazy as BSL
2822
import qualified Data.Hashable as DataHashable
29-
import Data.Kind (Type)
3023
import Data.List (foldl')
31-
import Data.Monoid
3224
import Data.Proxy (Proxy(Proxy))
3325
import Data.Text (Text)
3426
import qualified Data.Text as T
3527
import qualified Data.Text.Encoding as T
36-
import qualified Data.Vector as V
3728
import Data.Word (Word8)
38-
import GHC.TypeLits
29+
import GHC.TypeLits (Nat, KnownNat, natVal)
3930
import qualified System.Nix.Base32 as Base32
4031

4132
-- | The universe of supported hash algorithms.
@@ -58,7 +49,7 @@ newtype Digest (a :: HashAlgorithm) =
5849
-- 'HashAlgorithm'. Every 'HashAlgorithm' should have an instance.
5950
class ValidAlgo (a :: HashAlgorithm) where
6051
-- | The incremental state for constructing a hash.
61-
type AlgoCtx a :: Type
52+
type AlgoCtx a
6253

6354
-- | Start building a new hash.
6455
initialize :: AlgoCtx a
@@ -69,7 +60,7 @@ class ValidAlgo (a :: HashAlgorithm) where
6960

7061
-- | An algorithm with a canonical name, for serialization purposes
7162
-- (e.g. SRI hashes)
72-
class NamedAlgo a where
63+
class NamedAlgo (a :: HashAlgorithm) where
7364
algoName :: Text
7465

7566
instance NamedAlgo 'MD5 where

0 commit comments

Comments
 (0)