intro 0.5.2.1 → 0.6.0.0
raw patch · 3 files changed
+73/−27 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Intro: foldl1Def :: Foldable t => a -> (a -> a -> a) -> t a -> a
- Intro: foldr1Def :: Foldable t => a -> (a -> a -> a) -> t a -> a
- Intro: maximumByDef :: Foldable t => a -> (a -> a -> Ordering) -> t a -> a
- Intro: maximumDef :: (Foldable t, Ord a) => a -> t a -> a
- Intro: minimumByDef :: Foldable t => a -> (a -> a -> Ordering) -> t a -> a
- Intro: minimumDef :: (Foldable t, Ord a) => a -> t a -> a
+ Intro: maximumBound :: (Foldable f, Ord a) => a -> f a -> a
+ Intro: maximumBoundBy :: Foldable f => a -> (a -> a -> Ordering) -> f a -> a
+ Intro: maximumBounded :: (Foldable f, Ord a, Bounded a) => f a -> a
+ Intro: maximumBoundedBy :: (Foldable f, Bounded a) => (a -> a -> Ordering) -> f a -> a
+ Intro: minimumBound :: (Foldable f, Ord a) => a -> f a -> a
+ Intro: minimumBoundBy :: Foldable f => a -> (a -> a -> Ordering) -> f a -> a
+ Intro: minimumBounded :: (Foldable f, Ord a, Bounded a) => f a -> a
+ Intro: minimumBoundedBy :: (Foldable f, Bounded a) => (a -> a -> Ordering) -> f a -> a
+ Intro: newtype ReaderT r (m :: Type -> Type) a
- Intro: ReaderT :: (r -> m a) -> ReaderT r
+ Intro: ReaderT :: (r -> m a) -> ReaderT r a
- Intro: [runReaderT] :: ReaderT r -> r -> m a
+ Intro: [runReaderT] :: ReaderT r a -> r -> m a
- Intro: newtype ReaderT r (m :: k -> Type) (a :: k) :: forall k. () => Type -> k -> Type -> k -> Type
+ Intro: newtype Const a (b :: k) :: forall k. () => Type -> k -> Type
Files
- README.md +2/−2
- intro.cabal +16/−16
- src/Intro.hs +55/−9
README.md view
@@ -15,14 +15,14 @@ List of design decisions: -* Keep everything at one place (There are three modules and Intro.Trustworthy is needed for Safe Haskell)+* Keep everything at one place (Actually there are three modules; Intro.Trustworthy is needed for Safe Haskell) * Conservative extension over the base Prelude * Rely only on common additional libraries * Avoid writing custom functions * Export everything explicitly to provide a stable interface and good documentation * Export only total functions or provide safe alternatives (Very few exceptions like div etc.) * Prefer Text over String, provide ConvertString and EncodeString-* Provide Monad transformers+* Provide monad transformers * Provide container types * Prefer generic functions * Debugging functions, like 'Intro.Trustworthy.trace' and 'undefined' are available but produce compile time warnings
intro.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.0.+-- This file has been generated from package.yaml by hpack version 0.31.2. -- -- see: https://github.com/sol/hpack ----- hash: 8207d6b332a3f7b1a3947e6fb3554af3e2228b7d202d23ac1b9c2321323e9589+-- hash: fe9a993c4dcd595f1858f7bb1fea002353d77bcdd733200b90049ea61a13c0a8 name: intro-version: 0.5.2.1+version: 0.6.0.0 synopsis: Safe and minimal prelude description: Intro is a modern Prelude which provides safe alternatives for most of the partial functions and follows other@@ -29,7 +29,7 @@ copyright: 2016-2017 Daniel Mendler license: MIT license-file: LICENSE-tested-with: GHC == 8.0.1, GHC == 8.2.1, GHC == 8.4.3, GHC == 8.6.1+tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.4 build-type: Simple extra-source-files: README.md@@ -39,6 +39,12 @@ location: https://github.com/minad/intro library+ exposed-modules:+ Intro+ other-modules:+ Intro.ConvertString+ Intro.Trustworthy+ Paths_intro hs-source-dirs: src ghc-options: -Wall@@ -49,7 +55,7 @@ , deepseq >=1.4 && <1.5 , dlist >=0.7 && <0.9 , extra >=1.5.1 && <1.7- , hashable >=1.2.5 && <1.3+ , hashable >=1.2.5 && <2.0 , mtl >=2.2 && <2.3 , safe >=0.3.11 && <0.4 , text >=0.7 && <1.3@@ -59,17 +65,15 @@ if impl(ghc < 8.1) build-depends: bifunctors >=5.2 && <5.5- exposed-modules:- Intro- other-modules:- Intro.ConvertString- Intro.Trustworthy- Paths_intro default-language: Haskell2010 test-suite test type: exitcode-stdio-1.0 main-is: test.hs+ other-modules:+ BaseCompat+ LensCompat+ Paths_intro hs-source-dirs: test ghc-options: -Wall@@ -81,7 +85,7 @@ , deepseq >=1.4 && <1.5 , dlist >=0.7 && <0.9 , extra >=1.5.1 && <1.7- , hashable >=1.2.5 && <1.3+ , hashable >=1.2.5 && <2.0 , intro , lens , mtl >=2.2 && <2.3@@ -93,8 +97,4 @@ if impl(ghc < 8.1) build-depends: bifunctors >=5.2 && <5.5- other-modules:- BaseCompat- LensCompat- Paths_intro default-language: Haskell2010
src/Intro.hs view
@@ -59,11 +59,13 @@ -- functions are exported from the 'safe' package, e.g., 'headMay'. -- -- * 'cycle', 'head', 'tail', 'init', 'last'+-- * 'toEnum', 'pred', 'succ' ----- The following functions have been replaced by their '*May' and '*Def' variants:+-- The 'maximum' and 'minimum' functions have been replaced by variants which+-- are safe for empty structures. ----- * 'foldl1', 'foldr1', 'maximum', 'minimum'--- * 'toEnum', 'pred', 'succ'+-- * 'maximumBound', 'maximumBounded', ...+-- * 'minimumBound, 'minimumBounded', ... -- -- These functions are not provided for various reasons: --@@ -475,17 +477,19 @@ , Data.Foldable.notElem , Data.Foldable.sequenceA_ , Safe.Foldable.foldl1May- , Safe.Foldable.foldl1Def , Safe.Foldable.foldr1May- , Safe.Foldable.foldr1Def , Safe.Foldable.maximumByMay- , Safe.Foldable.maximumByDef+ , maximumBoundedBy+ , maximumBoundBy , Safe.Foldable.minimumByMay- , Safe.Foldable.minimumByDef+ , minimumBoundedBy+ , minimumBoundBy , Safe.Foldable.maximumMay- , Safe.Foldable.maximumDef+ , maximumBounded+ , maximumBound , Safe.Foldable.minimumMay- , Safe.Foldable.minimumDef+ , minimumBounded+ , minimumBound -- ** Traversable , Data.Traversable.Traversable(traverse, sequenceA)@@ -765,6 +769,48 @@ -- | Alias for lazy 'Data.ByteString.Lazy.ByteString' type LByteString = Data.ByteString.Lazy.ByteString++-- | The largest element of a foldable structure with respect to the+-- given comparison function. The result is bounded by the value given as the first argument.+maximumBoundBy :: Data.Foldable.Foldable f => a -> (a -> a -> Prelude.Ordering) -> f a -> a+maximumBoundBy x f xs = Data.Foldable.maximumBy f $ x : Data.Foldable.toList xs++-- | The smallest element of a foldable structure with respect to the+-- given comparison function. The result is bounded by the value given as the first argument.+minimumBoundBy :: Data.Foldable.Foldable f => a -> (a -> a -> Prelude.Ordering) -> f a -> a+minimumBoundBy x f xs = Data.Foldable.minimumBy f $ x : Data.Foldable.toList xs++-- | The largest element of a foldable structure with respect to the+-- given comparison function. The result is bounded by 'Prelude.minBound'.+maximumBoundedBy :: (Data.Foldable.Foldable f, Prelude.Bounded a)+ => (a -> a -> Prelude.Ordering) -> f a -> a+maximumBoundedBy = maximumBoundBy Prelude.minBound++-- | The smallest element of a foldable structure with respect to the+-- given comparison function. The result is bounded by 'Prelude.maxBound'.+minimumBoundedBy :: (Data.Foldable.Foldable f, Prelude.Bounded a)+ => (a -> a -> Prelude.Ordering) -> f a -> a+minimumBoundedBy = minimumBoundBy Prelude.maxBound++-- | The largest element of a foldable structure.+-- The result is bounded by the value given as the first argument.+maximumBound :: (Data.Foldable.Foldable f, Prelude.Ord a) => a -> f a -> a+maximumBound x xs = Data.Foldable.maximum $ x : Data.Foldable.toList xs++-- | The smallest element of a foldable structure.+-- The result is bounded by the value given as the first argument.+minimumBound :: (Data.Foldable.Foldable f, Prelude.Ord a) => a -> f a -> a+minimumBound x xs = Data.Foldable.minimum $ x : Data.Foldable.toList xs++-- | The largest element of a foldable structure.+-- The result is bounded by 'Prelude.minBound'.+maximumBounded :: (Data.Foldable.Foldable f, Prelude.Ord a, Prelude.Bounded a) => f a -> a+maximumBounded = maximumBound Prelude.minBound++-- | The largest element of a foldable structure.+-- The result is bounded by 'Prelude.maxBound'.+minimumBounded :: (Data.Foldable.Foldable f, Prelude.Ord a, Prelude.Bounded a) => f a -> a+minimumBounded = minimumBound Prelude.maxBound -- | Convert from 'Data.Foldable.Foldable' to an 'IsList' type. fromFoldable :: (Data.Foldable.Foldable f, IsList a) => f (Item a) -> a