boring 0.2.1 → 0.2.2
raw patch · 3 files changed
+17/−51 lines, 3 filesdep −semigroupsdep −transformers-compatdep −type-equalitydep ~basedep ~transformersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: semigroups, transformers-compat, type-equality, void
Dependency ranges changed: base, transformers
API changes (from Hackage documentation)
- Data.Boring: instance Data.Boring.Absurd Data.Void.Void
+ Data.Boring: instance Data.Boring.Absurd GHC.Base.Void
+ Data.Boring: instance GHC.TypeLits.KnownChar n => Data.Boring.Boring (GHC.TypeLits.SChar n)
+ Data.Boring: instance GHC.TypeLits.KnownSymbol n => Data.Boring.Boring (GHC.TypeLits.SSymbol n)
+ Data.Boring: instance GHC.TypeNats.KnownNat n => Data.Boring.Boring (GHC.TypeNats.SNat n)
+ Data.Boring: instance GHC.Types.Coercible a b => Data.Boring.Boring (Data.Type.Coercion.Coercion a b)
Files
- ChangeLog.md +4/−0
- boring.cabal +13/−29
- src/Data/Boring.hs +0/−22
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for boring +## 0.2.2++- Support GHC-8.6.5...9.10.1+ ## 0.2.1 - Add instances for `SNat`, `SSymbol`, and `SChar`
boring.cabal view
@@ -1,16 +1,17 @@+cabal-version: 2.2 name: boring-version: 0.2.1+version: 0.2.2 synopsis: Boring and Absurd types description: * @Boring@ types are isomorphic to @()@.- . + . * @Absurd@ types are isomorphic to @Void@. . See [What does () mean in Haskell -answer by Conor McBride](https://stackoverflow.com/questions/33112439/what-does-mean-in-haskell/33115522#33115522) homepage: https://github.com/phadej/boring bug-reports: https://github.com/phadej/boring/issues-license: BSD3+license: BSD-3-Clause license-file: LICENSE author: Oleg Grenrus <oleg.grenrus@iki.fi> maintainer: Oleg.Grenrus <oleg.grenrus@iki.fi>@@ -18,22 +19,16 @@ category: Data build-type: Simple extra-source-files: ChangeLog.md-cabal-version: >=1.10 tested-with:- GHC ==7.4.2- || ==7.6.3- || ==7.8.4- || ==7.10.3- || ==8.0.2- || ==8.2.2- || ==8.4.4- || ==8.6.5+ GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2- || ==9.2.7- || ==9.4.4- || ==9.6.1+ || ==9.2.8+ || ==9.4.8+ || ==9.6.5+ || ==9.8.2+ || ==9.10.1 source-repository head type: git@@ -52,24 +47,13 @@ library exposed-modules: Data.Boring build-depends:- base >=4.5 && <4.19- , transformers >=0.3 && <0.7+ base >=4.12.0.0 && <4.21+ , transformers >=0.5.6.2 && <0.7 if impl(ghc <7.6) build-depends: ghc-prim- - if !impl(ghc >=7.8)- build-depends: type-equality >=1 && <1.1 - if !impl(ghc >=7.10)- build-depends: void >=0.7.3 && <0.8-- if !impl(ghc >=8.0)- build-depends:- semigroups >=0.18.5 && <0.21- , transformers-compat >=0.5 && <0.8-- if flag(tagged) || !impl(ghc >=7.8)+ if flag(tagged) build-depends: tagged >=0.8.6 && <0.9 other-extensions:
src/Data/Boring.hs view
@@ -4,9 +4,7 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeOperators #-}-#if __GLASGOW_HASKELL >= 708 {-# LANGUAGE EmptyCase #-}-#endif -- | 'Boring' and 'Absurd' classes. One approach. -- -- Different approach would be to have@@ -79,18 +77,12 @@ import qualified Data.Void as V -#if __GLASGOW_HASKELL >= 708 import qualified Data.Coerce as Co import qualified Data.Type.Coercion as Co-#else-import Prelude (seq, error)-#endif import qualified Data.Type.Equality as Eq -#if MIN_VERSION_base(4,10,0) import qualified Type.Reflection as Typeable-#endif #if MIN_VERSION_base(4,18,0) import qualified GHC.TypeLits as TypeLits@@ -189,26 +181,20 @@ instance Absurd a => Boring (Maybe a) where boring = Nothing -#if __GLASGOW_HASKELL >= 708 -- | Coercibility is 'Boring' too. instance Co.Coercible a b => Boring (Co.Coercion a b) where boring = Co.Coercion-#endif -- | Homogeneous type equality is 'Boring' too. instance a ~ b => Boring (a Eq.:~: b) where boring = Eq.Refl -# if MIN_VERSION_base(4,10,0) -- | Heterogeneous type equality is 'Boring' too. instance a Eq.~~ b => Boring (a Eq.:~~: b) where boring = Eq.HRefl-# endif -#if MIN_VERSION_base(4,10,0) instance Typeable.Typeable a => Boring (Typeable.TypeRep a) where boring = Typeable.typeRep-#endif #if MIN_VERSION_base(4,18,0) instance TypeLits.KnownChar n => Boring (TypeLits.SChar n) where@@ -295,11 +281,7 @@ ------------------------------------------------------------------------------- instance Absurd (V1 p) where-#if __GLASGOW_HASKELL >= 708 absurd v = case v of {}-#else- absurd v = v `seq` error "absurd @(V1 p)"-#endif instance Absurd c => Absurd (K1 i c p) where absurd = absurd . unK1@@ -399,11 +381,7 @@ gabsurd :: f a -> b instance GAbsurd V1 where-#if __GLASGOW_HASKELL >= 708 gabsurd x = case x of {}-#else- gabsurd x = x `seq` error "gabsurd @V1"-#endif instance GAbsurd f => GAbsurd (M1 i c f) where gabsurd (M1 x) = gabsurd x