From 4c1adc80e9e8fc6c9e71ddedc3b559be51f5985f Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Sat, 9 Jan 2021 17:33:07 +0200 Subject: [PATCH] Data.Some is safe too, prelare 1.0.2 --- ChangeLog.md | 7 +++++-- some.cabal | 9 +++++++-- src/Data/Some.hs | 7 ++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index cbcfdbe..f0bb4c1 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,9 @@ -# 1.0.1.1 +# 1.0.2 -- GHC-9.0 compatibility +- Explicitly mark `Data.Some` as `Safe`. + It was previously inferred, yet it was Safe too, + as it only re-exports other explicitly marked modules. +- Allow `base-4.15`, GHC-9.0 compatibility # 1.0.1 diff --git a/some.cabal b/some.cabal index 400ef45..d99a154 100644 --- a/some.cabal +++ b/some.cabal @@ -1,5 +1,5 @@ name: some -version: 1.0.1.1 +version: 1.0.2 stability: provisional cabal-version: >=1.10 build-type: Simple @@ -70,7 +70,7 @@ library other-modules: Data.GADT.Internal build-depends: - base >=4.3 && <4.15 + base >=4.3 && <4.16 , deepseq >=1.3.0.0 && <1.5 if !impl(ghc >=7.8) @@ -82,6 +82,11 @@ library , transformers >=0.3 && <0.6 , transformers-compat >=0.6 && <0.7 + if impl(ghc >= 9.0) + -- these flags may abort compilation with GHC-8.10 + -- https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3295 + ghc-options: -Winferred-safe-imports -Wmissing-safe-haskell-mode + test-suite hkd-example default-language: Haskell2010 type: exitcode-stdio-1.0 diff --git a/src/Data/Some.hs b/src/Data/Some.hs index 748413d..a816313 100644 --- a/src/Data/Some.hs +++ b/src/Data/Some.hs @@ -1,4 +1,9 @@ -{-# LANGUAGE CPP #-} +{-# LANGUAGE CPP #-} +#if __GLASGOW_HASKELL__ >= 704 +{-# LANGUAGE Safe #-} +#elif __GLASGOW_HASKELL__ >= 702 +{-# LANGUAGE Trustworthy #-} +#endif -- | An existential type. -- -- The constructor is exported only on GHC-8 and later.