Skip to content

Commit 07a05c7

Browse files
committed
Satisfy -Wstar-is-type
1 parent 51d8113 commit 07a05c7

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

hackage-security/src/Hackage/Security/Client/Formats.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module Hackage.Security.Client.Formats (
1818
) where
1919

2020
import Prelude
21+
import Data.Kind (Type)
2122
import Hackage.Security.Util.Stack
2223
import Hackage.Security.Util.TypedEmbedded
2324

@@ -31,7 +32,7 @@ data FormatGz
3132
-- | Format is a singleton type (reflection type to term level)
3233
--
3334
-- NOTE: In the future we might add further compression formats.
34-
data Format :: * -> * where
35+
data Format :: Type -> Type where
3536
FUn :: Format FormatUn
3637
FGz :: Format FormatGz
3738

@@ -55,7 +56,7 @@ instance Unify Format where
5556
--
5657
-- NOTE: If we add additional cases here (for dealing with additional formats)
5758
-- all calls to @error "inaccessible"@ need to be reevaluated.
58-
data Formats :: * -> * -> * where
59+
data Formats :: Type -> Type -> Type where
5960
FsNone :: Formats () a
6061
FsUn :: a -> Formats (FormatUn :- ()) a
6162
FsGz :: a -> Formats (FormatGz :- ()) a
@@ -74,7 +75,7 @@ instance Functor (Formats fs) where
7475
-- | @HasFormat fs f@ is a proof that @f@ is a key in @fs@.
7576
--
7677
-- See 'formatsMember' and 'formatsLookup' for typical usage.
77-
data HasFormat :: * -> * -> * where
78+
data HasFormat :: Type -> Type -> Type where
7879
HFZ :: Format f -> HasFormat (f :- fs) f
7980
HFS :: HasFormat fs f -> HasFormat (f' :- fs) f
8081

hackage-security/src/Hackage/Security/Client/Repository.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module Hackage.Security.Client.Repository (
3232

3333
import Prelude
3434
import Control.Exception
35+
import Data.Kind (Type)
3536
import Data.Typeable (Typeable)
3637
import qualified Codec.Archive.Tar.Index as Tar
3738
import qualified Data.ByteString.Lazy as BS.L
@@ -63,7 +64,7 @@ data Binary
6364
-- is metadata actual binary content.
6465
--
6566
-- NOTE: Haddock lacks GADT support so constructors have only regular comments.
66-
data RemoteFile :: * -> * -> * where
67+
data RemoteFile :: Type -> Type -> Type where
6768
-- Timestamp metadata (@timestamp.json@)
6869
--
6970
-- We never have (explicit) file length available for timestamps.
@@ -361,7 +362,7 @@ data UpdateFailure =
361362
Downloaded files
362363
-------------------------------------------------------------------------------}
363364

364-
class DownloadedFile (down :: * -> *) where
365+
class DownloadedFile (down :: Type -> Type) where
365366
-- | Verify a download file
366367
downloadedVerify :: down a -> Trusted FileInfo -> IO Bool
367368

@@ -381,7 +382,7 @@ class DownloadedFile (down :: * -> *) where
381382
--
382383
-- For instance, for repositories using HTTP this might correspond to a 404;
383384
-- for local repositories this might correspond to file-not-found, etc.
384-
data SomeRemoteError :: * where
385+
data SomeRemoteError :: Type where
385386
SomeRemoteError :: Exception e => e -> SomeRemoteError
386387
deriving (Typeable)
387388

@@ -419,7 +420,7 @@ remoteRepoPath' repoLayout file format =
419420
-------------------------------------------------------------------------------}
420421

421422
-- | Is a particular remote file cached?
422-
data IsCached :: * -> * where
423+
data IsCached :: Type -> Type where
423424
-- This remote file should be cached, and we ask for it by name
424425
CacheAs :: CachedFile -> IsCached Metadata
425426

hackage-security/src/Hackage/Security/Client/Repository/Remote.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import Control.Concurrent
3232
import Control.Exception
3333
import Control.Monad (when, unless)
3434
import Control.Monad.IO.Class (MonadIO)
35+
import Data.Kind (Type)
3536
import Data.List (nub, intercalate)
3637
import Data.Typeable
3738
import Network.URI hiding (uriPath, path)
@@ -300,7 +301,7 @@ withMirror HttpLib{}
300301
-------------------------------------------------------------------------------}
301302

302303
-- | Download method (downloading or updating)
303-
data DownloadMethod :: * -> * -> * where
304+
data DownloadMethod :: Type -> Type -> Type where
304305
-- Download this file (we never attempt to update this type of file)
305306
NeverUpdated :: {
306307
neverUpdatedFormat :: HasFormat fs f
@@ -595,7 +596,7 @@ fileLength' = fileLength . fileInfoLength . trusted
595596
Files downloaded from the remote repository
596597
-------------------------------------------------------------------------------}
597598

598-
data RemoteTemp :: * -> * where
599+
data RemoteTemp :: Type -> Type where
599600
DownloadedWhole :: {
600601
wholeTemp :: Path Absolute
601602
} -> RemoteTemp a

hackage-security/src/Hackage/Security/TUF/Layout/Index.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Hackage.Security.TUF.Layout.Index (
1010
) where
1111

1212
import Prelude
13+
import Data.Kind (Type)
1314
import Distribution.Package
1415
import Distribution.Text
1516

@@ -43,7 +44,7 @@ data IndexLayout = IndexLayout {
4344
-- TODO: If we wanted to support legacy Hackage, we should also have a case for
4445
-- the global preferred-versions file. But supporting legacy Hackage will
4546
-- probably require more work anyway..
46-
data IndexFile :: * -> * where
47+
data IndexFile :: Type -> Type where
4748
-- Package-specific metadata (@targets.json@)
4849
IndexPkgMetadata :: PackageIdentifier -> IndexFile (Signed Targets)
4950

hackage-security/src/Hackage/Security/Util/TypedEmbedded.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module Hackage.Security.Util.TypedEmbedded (
88
) where
99

1010
import Prelude
11+
import Data.Kind (Type)
1112

1213
-- | Type equality proofs
1314
--
@@ -16,7 +17,7 @@ import Prelude
1617
data a :=: b where
1718
Refl :: a :=: a
1819

19-
type family TypeOf (f :: * -> *) :: * -> *
20+
type family TypeOf (f :: Type -> Type) :: Type -> Type
2021

2122
-- | Equality check that gives us a type-level equality proof.
2223
class Unify f where

hackage-security/tests/TestSuite/InMemRepo.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module TestSuite.InMemRepo (
88

99
-- stdlib
1010
import Control.Exception
11+
import Data.Kind (Type)
1112
import Data.Time
1213
import qualified Codec.Archive.Tar as Tar
1314
import qualified Codec.Compression.GZip as GZip
@@ -33,7 +34,7 @@ import TestSuite.Util.StrictMVar
3334
"Files" from the in-memory repository
3435
-------------------------------------------------------------------------------}
3536

36-
data InMemFile :: * -> * where
37+
data InMemFile :: Type -> Type where
3738
InMemMetadata :: ToJSON WriteJSON a => RepoLayout -> a -> InMemFile Metadata
3839
InMemBinary :: BS.L.ByteString -> InMemFile Binary
3940

0 commit comments

Comments
 (0)