mirror of
https://github.com/haskell-nix/hnix.git
synced 2024-09-11 06:55:38 +03:00
Compile on GHC 9.4.3 (#1081)
* Compile on GHC 9.4.3 * Add GHC 9.2 and 9.4 to CI
This commit is contained in:
parent
6eaf31a341
commit
b89eed944c
2
.github/workflows/Cabal-Linux.yml
vendored
2
.github/workflows/Cabal-Linux.yml
vendored
@ -22,6 +22,8 @@ jobs:
|
||||
ghc:
|
||||
[ "8.8"
|
||||
, "9.0"
|
||||
, "9.2"
|
||||
, "9.4"
|
||||
]
|
||||
steps:
|
||||
|
||||
|
2
.github/workflows/Cabal-macOS.yml
vendored
2
.github/workflows/Cabal-macOS.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
# It is dev env, so trying to stick to last GHC.
|
||||
ghc: [ "9.0" ]
|
||||
ghc: [ "9.4" ]
|
||||
steps:
|
||||
|
||||
- name: "Git checkout"
|
||||
|
@ -1,3 +1,7 @@
|
||||
packages:
|
||||
./hnix.cabal
|
||||
|
||||
allow-newer:
|
||||
lens-family-th:template-haskell,
|
||||
relude:base,
|
||||
relude:ghc-prim,
|
||||
|
13
hnix.cabal
13
hnix.cabal
@ -351,17 +351,18 @@ common shared
|
||||
, BangPatterns
|
||||
, ViewPatterns
|
||||
build-depends:
|
||||
base >= 4.12 && < 4.16
|
||||
base >= 4.12 && < 4.18
|
||||
, data-fix >= 0.3.0 && < 0.4
|
||||
, exceptions >= 0.10.0 && < 0.11
|
||||
, filepath >= 1.4.2 && < 1.5
|
||||
, optparse-applicative >= 0.14.3 && < 0.17
|
||||
, relude >= 1.0.0 && < 1.1.0
|
||||
, relude >= 1.0.0 && < 1.2
|
||||
, serialise >= 0.2.1 && < 0.3
|
||||
, template-haskell >= 2.13 && < 2.18
|
||||
, time >= 1.8.0 && < 1.9 || >= 1.9.3 && < 1.10
|
||||
, template-haskell >= 2.13 && < 2.20
|
||||
, time >= 1.8.0 && < 1.9 || >= 1.9.3 && < 1.13
|
||||
ghc-options:
|
||||
-Wall
|
||||
-Wno-incomplete-uni-patterns
|
||||
-fprint-potential-instances
|
||||
if flag(optimize)
|
||||
default-extensions:
|
||||
@ -435,7 +436,7 @@ library
|
||||
hs-source-dirs:
|
||||
src
|
||||
build-depends:
|
||||
aeson >= 1.4.2 && < 1.6 || >= 2.0 && < 2.1
|
||||
aeson >= 1.4.2 && < 1.6 || >= 2.0 && < 2.2
|
||||
, array >= 0.4 && < 0.6
|
||||
, base16-bytestring >= 0.1.1 && < 1.1
|
||||
, binary >= 0.8.5 && < 0.9
|
||||
@ -482,7 +483,7 @@ library
|
||||
-- aka Lift Text, Bytestring, Vector, Containers,
|
||||
-- we use Lift Text particulrarly for GHC 8.6
|
||||
, th-lift-instances >= 0.1 && < 0.2
|
||||
, text >= 1.2.3 && < 1.3
|
||||
, text >= 1.2.3 && < 2.1
|
||||
, these >= 1.0.1 && < 1.2
|
||||
, transformers >= 0.5.5 && < 0.6
|
||||
, transformers-base >= 0.4.5 && < 0.5
|
||||
|
@ -6,6 +6,7 @@
|
||||
{-# language GeneralizedNewtypeDeriving #-}
|
||||
{-# language UndecidableInstances #-}
|
||||
{-# language PackageImports #-} -- 2021-07-05: Due to hashing Haskell IT system situation, in HNix we currently ended-up with 2 hash package dependencies @{hashing, cryptonite}@
|
||||
{-# language TypeOperators #-}
|
||||
|
||||
{-# options_ghc -Wno-orphans #-}
|
||||
|
||||
@ -312,8 +313,8 @@ instance MonadHttp IO where
|
||||
let body = responseBody response
|
||||
-- let digest::Hash.Digest Hash.SHA256 = Hash.hash $ (B.concat . BL.toChunks) body
|
||||
let name = baseNameOf url
|
||||
bool
|
||||
(pure $ Left $ ErrorCall $ "fail, got " <> show status <> " when fetching url = " <> urlstr)
|
||||
bool
|
||||
(pure $ Left $ ErrorCall $ "fail, got " <> show status <> " when fetching url = " <> urlstr)
|
||||
-- using addTextToStore' result in different hash from the addToStore.
|
||||
-- see https://github.com/haskell-nix/hnix/pull/1051#issuecomment-1031380804
|
||||
(addToStore name (NarText $ toStrict body) False False)
|
||||
@ -415,7 +416,7 @@ instance MonadStore IO where
|
||||
(\ err -> pure $ Left $ ErrorCall $ "String '" <> show name <> "' is not a valid path name: " <> err)
|
||||
(\ pathName ->
|
||||
do
|
||||
res <- Store.Remote.runStore $ Store.Remote.addToStore @Hash.SHA256 pathName (toNarSource content) recursive repair
|
||||
res <- Store.Remote.runStore $ Store.Remote.addToStore @Hash.SHA256 pathName (toNarSource content) recursive repair
|
||||
either
|
||||
Left -- err
|
||||
(pure . toStorePath) -- store path
|
||||
|
@ -503,7 +503,7 @@ instance MonadThrow (Lint s) where
|
||||
throwM e = Lint $ ReaderT $ const (throw e)
|
||||
|
||||
instance MonadCatch (Lint s) where
|
||||
catch _m _h = Lint $ ReaderT $ const (fail "Cannot catch in 'Lint s'")
|
||||
catch _m _h = Lint $ ReaderT $ const (error "Cannot catch in 'Lint s'")
|
||||
|
||||
runLintM :: Options -> Lint s a -> ST s a
|
||||
runLintM opts action =
|
||||
|
@ -1,6 +1,7 @@
|
||||
{-# language DefaultSignatures #-}
|
||||
{-# language FunctionalDependencies #-}
|
||||
{-# language TypeFamilies #-}
|
||||
{-# language TypeOperators #-}
|
||||
|
||||
module Nix.Thunk where
|
||||
|
||||
|
@ -267,10 +267,10 @@ hoistNValueF lft =
|
||||
-- * @__NValue'__@: forming the (F(A))
|
||||
|
||||
-- | NVConstraint constraint the f layer in @NValue'@.
|
||||
-- It makes bijection between sub category of Hask and Nix Value possible.
|
||||
-- It makes bijection between sub category of Hask and Nix Value possible.
|
||||
-- 'Comonad' enable Nix Value to Hask part.
|
||||
-- 'Applicative' enable Hask to Nix Value part.
|
||||
type NVConstraint f = (Comonad f, Applicative f)
|
||||
type NVConstraint f = (Comonad f, Applicative f)
|
||||
|
||||
-- | At the time of constructor, the expected arguments to closures are values
|
||||
-- that may contain thunks. The type of such thunks are fixed at that time.
|
||||
@ -400,7 +400,7 @@ unliftNValue' = hoistNValue' lift
|
||||
--
|
||||
-- Since it is a proper way of scientific implementation, we would eventually form a
|
||||
-- lawful functor.
|
||||
--
|
||||
--
|
||||
-- Module pattens use @language PatternSynonyms@: bidirectional synonyms (@<-@),
|
||||
-- and @ViewPatterns@: (@->@) at the same time.
|
||||
-- @ViewPatterns Control.Comonad.extract@ extracts
|
||||
@ -425,7 +425,7 @@ pattern NVConstant' x <- NValue' (extract -> NVConstantF x)
|
||||
-- | Haskell text & context to the Nix text & context,
|
||||
pattern NVStr' :: NVConstraint w => NixString -> NValue' t w m a
|
||||
pattern NVStr' ns <- NValue' (extract -> NVStrF ns)
|
||||
where NVStr' = NValue' . pure . NVStrF
|
||||
where NVStr' = NValue' . pure . NVStrF
|
||||
|
||||
-- | Haskell @Path@ to the Nix path,
|
||||
pattern NVPath' :: NVConstraint w => Path -> NValue' t w m a
|
||||
@ -528,7 +528,7 @@ liftNValue
|
||||
=> (forall x . u m x -> m x)
|
||||
-> NValue t f m
|
||||
-> NValue t f (u m)
|
||||
liftNValue = (`hoistNValue` lift)
|
||||
liftNValue f = hoistNValue f lift
|
||||
|
||||
|
||||
-- *** MonadTransUnlift
|
||||
@ -603,7 +603,7 @@ pattern NVStr ns = Free (NVStr' ns)
|
||||
pattern NVPath x = Free (NVPath' x)
|
||||
pattern NVList l = Free (NVList' l)
|
||||
pattern NVSet s x = Free (NVSet' s x)
|
||||
pattern NVBuiltin name f = Free (NVBuiltin' name f)
|
||||
pattern NVBuiltin name f = Free (NVBuiltin' name f)
|
||||
pattern NVClosure x f = Free (NVClosure' x f)
|
||||
{-# complete NVThunk, NVConstant, NVStr, NVPath, NVList, NVSet, NVClosure, NVBuiltin #-}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user