OneTuple 0.4.1.1 → 0.4.2
raw patch · 2 files changed
+9/−109 lines, 2 filesdep ~basedep ~hashabledep ~semigroupsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, hashable, semigroups, transformers, transformers-compat
API changes (from Hackage documentation)
- Data.Tuple.Solo: Solo :: a -> Solo a
- Data.Tuple.Solo: pattern MkSolo :: a -> Solo a
+ Data.Tuple.Solo: MkSolo :: a -> Solo a
+ Data.Tuple.Solo: pattern Solo :: a -> Solo a
- Data.Tuple.Solo: data Solo a
+ Data.Tuple.Solo: data () => Solo a
Files
- OneTuple.cabal +9/−38
- src/Data/Tuple/Solo.hs +0/−71
OneTuple.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: OneTuple-version: 0.4.1.1+version: 0.4.2 synopsis: Singleton Tuple category: Data description:@@ -22,22 +22,15 @@ stability: experimental build-type: Simple tested-with:- GHC ==7.0.4- || ==7.2.2- || ==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.5- || ==9.4.4- || ==9.6.1+ || ==9.2.8+ || ==9.4.7+ || ==9.6.3+ || ==9.8.2+ || ==9.10.1 extra-source-files: Changelog.md @@ -54,35 +47,13 @@ hs-source-dirs: src build-depends:- base >=4.3 && <4.19+ base >=4.12 && <4.21 , template-haskell if impl(ghc >=9.0) build-depends: ghc-prim- else- if impl(ghc >=7.4)- build-depends: hashable >=1.3.5.0 && <1.5-- else- build-depends: hashable >=1.2.5.0 && <1.3-- -- generics- if !impl(ghc >=7.6)- build-depends: ghc-prim-- if !impl(ghc >=8.0)- build-depends:- semigroups >=0.18.4 && <0.21- , transformers >=0.3 && <0.7-- -- Ensure Data.Functor.Classes is always available- if impl(ghc >=7.10)- build-depends: transformers >=0.4.2.0-- else- build-depends: transformers-compat >=0.5.1.0 && <0.8-+ build-depends: hashable >=1.3.5.0 && <1.5 if !impl(ghc >=9.0) build-depends: foldable1-classes-compat >=0.1 && <0.2
src/Data/Tuple/Solo.hs view
@@ -1,19 +1,8 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}--#if __GLASGOW_HASKELL__ >=702 {-# LANGUAGE DeriveGeneric #-}-#endif--#if __GLASGOW_HASKELL__ >= 708 {-# LANGUAGE PatternSynonyms #-}-#endif--#if __GLASGOW_HASKELL__ >=704 {-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >=702-{-# LANGUAGE Trustworthy #-}-#endif -- | 'Solo' fills the /tuple gap/ with a singleton tuple. --@@ -33,14 +22,7 @@ -- Note: on GHC-9.0 'getSolo' is not a record selector. module Data.Tuple.Solo (-#if __GLASGOW_HASKELL__ >= 800 Solo(MkSolo,Solo),-#elif __GLASGOW_HASKELL__ >= 708- Solo(MkSolo),- pattern Solo,-#else- Solo(MkSolo),-#endif getSolo, ) where @@ -74,20 +56,6 @@ #else -#if MIN_VERSION_base(4,9,0)-#define LIFTED_FUNCTOR_CLASSES 1-#else-#if MIN_VERSION_transformers(0,5,0)-#define LIFTED_FUNCTOR_CLASSES 1-#else-#ifdef MIN_VERSION_transformers_compat-#if MIN_VERSION_transformers_compat(0,5,0) && !(MIN_VERSION_transformers(0,4,0))-#define LIFTED_FUNCTOR_CLASSES 1-#endif-#endif-#endif-#endif- import Control.Applicative (Applicative (..)) import Control.Monad (ap) import Control.Monad.Fix (MonadFix (..))@@ -109,41 +77,21 @@ import Data.Hashable.Lifted (Hashable1 (..), hashWithSalt1) #endif -#if LIFTED_FUNCTOR_CLASSES-#if MIN_VERSION_base(4,10,0) import Data.Functor.Classes (readData, readUnaryWith, liftReadListDefault, liftReadListPrecDefault)-#else-import Data.Functor.Classes (readsData, readsUnaryWith)-#endif-#endif--#if MIN_VERSION_base(4,4,0) import GHC.Generics (Generic, Generic1) import Control.Monad.Zip (MonadZip (..))-#endif -- | Solo is the singleton tuple data type. data Solo a = MkSolo { getSolo :: a } deriving ( Eq,Ord,Bounded,Read,Typeable,Data-#if MIN_VERSION_base(4,4,0) , Generic-#if __GLASGOW_HASKELL__ >=706 , Generic1-#endif-#endif ) -#if __GLASGOW_HASKELL__ >= 708-#if __GLASGOW_HASKELL__ >= 710 pattern Solo :: a -> Solo a-#endif pattern Solo a = MkSolo a-#endif--#if __GLASGOW_HASKELL__ >= 800 {-# COMPLETE Solo #-}-#endif instance Show a => Show (Solo a) where@@ -170,7 +118,6 @@ foldl1 _f (MkSolo x) = x -- TODO: add rest of the methods-#if MIN_VERSION_base(4,8,0) null _ = False length _ = 1 @@ -180,7 +127,6 @@ product = getSolo toList (MkSolo a) = [a]-#endif -- | @since 0.4 instance F1.Foldable1 Solo where@@ -205,9 +151,7 @@ _ *> x = x x <* _ = x -#if MIN_VERSION_base(4,10,0) liftA2 f (Solo x) (Solo y) = Solo (f x y)-#endif instance Monad Solo where return = pure@@ -224,12 +168,9 @@ instance MonadFix Solo where mfix f = let a = f (getSolo a) in a -#if MIN_VERSION_base(4,4,0) instance MonadZip Solo where mzipWith f (MkSolo a) (MkSolo b) = MkSolo (f a b)-#endif -#ifdef LIFTED_FUNCTOR_CLASSES instance Eq1 Solo where liftEq eq (MkSolo a) (MkSolo b) = a `eq` b @@ -237,26 +178,14 @@ liftCompare cmp (MkSolo a) (MkSolo b) = cmp a b instance Read1 Solo where-#if MIN_VERSION_base(4,10,0) liftReadPrec rp _ = readData (readUnaryWith rp "MkSolo" MkSolo) liftReadListPrec = liftReadListPrecDefault liftReadList = liftReadListDefault-#else- liftReadsPrec rp _ = readsData $ readsUnaryWith rp "MkSolo" MkSolo-#endif instance Show1 Solo where liftShowsPrec sp _ d (MkSolo x) = showParen (d > 10) $ showString "MkSolo " . sp 11 x--#else-instance Eq1 Solo where eq1 = (==)-instance Ord1 Solo where compare1 = compare-instance Read1 Solo where readsPrec1 = readsPrec-instance Show1 Solo where showsPrec1 = showsPrec-#endif- #endif #if !(MIN_VERSION_base(4,15,0))