homotuple 0.2.0.0 → 0.2.1.0
raw patch · 4 files changed
+40/−10 lines, 4 filesdep ~OneTuplePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: OneTuple
API changes (from Hackage documentation)
- Data.Tuple.Homotuple.OneTuple: instance GHC.Exts.IsList (Data.Tuple.OneTuple.OneTuple a)
Files
- ChangeLog.md +6/−0
- homotuple.cabal +10/−8
- src/Data/Tuple/Homotuple/OneTuple.hs +23/−1
- template/Homotuple.hs +1/−1
ChangeLog.md view
@@ -1,5 +1,11 @@ # Changelog for homotuple +## 0.2.1.0++2023.08.17++Support [OneTuple](https://hackage.haskell.org/package/OneTuple) 0.3, 0.4.+ ## 0.2.0.0 2021.03.19
homotuple.cabal view
@@ -1,7 +1,7 @@-cabal-version: 1.12+cabal-version: 2.2 name: homotuple-version: 0.2.0.0+version: 0.2.1.0 synopsis: Homotuple, all whose elements are the same type description: Homotuple, all whose elements are the same type category: Data@@ -14,9 +14,11 @@ license-file: LICENSE build-type: Custom -extra-source-files:+extra-doc-files: README.md ChangeLog.md++extra-source-files: template/Homotuple.hs template/HomotupleItem.hs @@ -26,9 +28,9 @@ custom-setup setup-depends:- Cabal- , base- , directory+ Cabal >=2 && <4,+ base >=4.10 && <5,+ directory >=1.3 && <1.4 library exposed-modules: Data.Tuple.Homotuple@@ -48,8 +50,8 @@ -Widentities -Wredundant-constraints -Wno-name-shadowing- build-depends: base >=4.10 && <4.15,- OneTuple >=0.2 && <0.3,+ build-depends: base >=4.10 && <5,+ OneTuple >=0.2 && <0.5, Only >=0.1 && <0.2, single-tuple >=0.1 && <0.2 if impl(ghc >= 8.4.0)
src/Data/Tuple/Homotuple/OneTuple.hs view
@@ -1,7 +1,13 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-}-{-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeFamilies #-} +#if MIN_VERSION_OneTuple(0,3,0) && MIN_VERSION_base(4,15,0)+{-# LANGUAGE Safe #-}+#else+{-# LANGUAGE Trustworthy #-}+#endif+ {-# OPTIONS_GHC -Wno-orphans #-} {-# OPTIONS_HADDOCK show-extensions #-}@@ -17,7 +23,22 @@ module Data.Tuple.Homotuple.OneTuple () where +#if MIN_VERSION_OneTuple(0,3,0)+#if !MIN_VERSION_base(4,15,0) import Data.Tuple.Homotuple (Homotuple, errorLengthMismatch)+import Data.Tuple.Solo (Solo (Solo))+import GHC.Exts (IsList (Item, fromList, toList))++type instance Homotuple 1 a = Solo a++instance IsList (Solo a) where+ type Item (Solo a) = a+ fromList [a] = Solo a+ fromList _ = errorLengthMismatch+ toList (Solo a) = [a]+#endif+#else+import Data.Tuple.Homotuple (Homotuple, errorLengthMismatch) import Data.Tuple.OneTuple (OneTuple (OneTuple)) import GHC.Exts (IsList (Item, fromList, toList)) @@ -28,3 +49,4 @@ fromList [a] = OneTuple a fromList _ = errorLengthMismatch toList (OneTuple a) = [a]+#endif
template/Homotuple.hs view
@@ -52,7 +52,7 @@ import Data.Tuple.Single (Single (wrap)) import GHC.Exts (IsList (Item, fromList, toList)) import GHC.Stack (HasCallStack)-import GHC.TypeLits (type (*), type (+), KnownNat, Nat, natVal)+import GHC.TypeLits (KnownNat, Nat, natVal, type (*), type (+)) type family Homotuple (n :: Nat) (a :: Type) = (t :: Type) | t -> n