salve 1.0.0 → 1.0.2
raw patch · 7 files changed
+142/−57 lines, 7 filesdep ~basedep ~doctestPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, doctest
API changes (from Hackage documentation)
- Salve.Internal: SCAnd :: SimpleConstraint -> SimpleConstraint -> SimpleConstraint
- Salve.Internal: SCEQ :: Version -> SimpleConstraint
- Salve.Internal: SCGT :: Version -> SimpleConstraint
- Salve.Internal: SCLT :: Version -> SimpleConstraint
- Salve.Internal: SCOr :: SimpleConstraint -> SimpleConstraint -> SimpleConstraint
- Salve.Internal: both :: (a -> b) -> (a, a) -> (b, b)
- Salve.Internal: buildP :: ReadP Build
- Salve.Internal: buildsP :: ReadP [Build]
- Salve.Internal: constraintP :: ReadP Constraint
- Salve.Internal: constraintsP :: ReadP Constraint
- Salve.Internal: data SimpleConstraint
- Salve.Internal: hyphenP :: ReadP ()
- Salve.Internal: hyphenatedP :: ReadP Constraint
- Salve.Internal: isAsciiDigitNonZero :: Char -> Bool
- Salve.Internal: isIdentifier :: Char -> Bool
- Salve.Internal: isWildcard :: Char -> Bool
- Salve.Internal: mkV :: Word64 -> Word64 -> Word64 -> Version
- Salve.Internal: nonZeroP :: ReadP Word64
- Salve.Internal: numberP :: ReadP Word64
- Salve.Internal: operatorP :: ReadP Operator
- Salve.Internal: orP :: ReadP ()
- Salve.Internal: parse :: ReadP a -> String -> Maybe a
- Salve.Internal: preReleaseNumberP :: ReadP PreRelease
- Salve.Internal: preReleaseP :: ReadP PreRelease
- Salve.Internal: preReleaseStringP :: ReadP PreRelease
- Salve.Internal: preReleasesP :: ReadP [PreRelease]
- Salve.Internal: primitiveP :: ReadP Constraint
- Salve.Internal: renderBuilds :: [Build] -> String
- Salve.Internal: renderPreReleases :: [PreRelease] -> String
- Salve.Internal: satisfiesSC :: SimpleConstraint -> Version -> Bool
- Salve.Internal: scGE :: Version -> SimpleConstraint
- Salve.Internal: scLE :: Version -> SimpleConstraint
- Salve.Internal: simpleP :: ReadP Constraint
- Salve.Internal: spaces1P :: ReadP ()
- Salve.Internal: spacesP :: ReadP ()
- Salve.Internal: stringToIntegral :: Integral a => String -> a
- Salve.Internal: toSC :: Constraint -> SimpleConstraint
- Salve.Internal: toWord64 :: Integer -> Maybe Word64
- Salve.Internal: versionP :: ReadP Version
- Salve.Internal: wildcardConstraintP :: ReadP Constraint
- Salve.Internal: wildcardMajorP :: ReadP Wildcard
- Salve.Internal: wildcardMinorP :: ReadP Wildcard
- Salve.Internal: wildcardP :: ReadP Wildcard
- Salve.Internal: wildcardPatchP :: ReadP Wildcard
- Salve.Internal: zeroP :: ReadP Word64
Files
- LICENSE.markdown +8/−8
- library/Salve.hs +33/−32
- library/Salve/Internal.hs +52/−8
- package.yaml +37/−0
- salve.cabal +9/−7
- stack.yaml +1/−0
- tests/Main.hs +2/−2
LICENSE.markdown view
@@ -1,13 +1,13 @@-# [The MIT License](https://opensource.org/licenses/MIT)+MIT License -Copyright 2017 Taylor Fausak+Copyright (c) 2018 Taylor Fausak -Permission is hereby granted, free of charge, to any person obtaining a copy of-this software and associated documentation files (the "Software"), to deal in-the Software without restriction, including without limitation the rights to-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies-of the Software, and to permit persons to whom the Software is furnished to do-so, subject to the following conditions:+Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
library/Salve.hs view
@@ -147,49 +147,49 @@ -- extension simply to deal with version numbers. -- * Types-Version,-PreRelease,-Build,-Constraint,+Salve.Version,+Salve.PreRelease,+Salve.Build,+Salve.Constraint, -- * Constructors-makeVersion,-initialVersion,+Salve.makeVersion,+Salve.initialVersion, -- * Parsing-parseVersion,-parsePreRelease,-parseBuild,-parseConstraint,+Salve.parseVersion,+Salve.parsePreRelease,+Salve.parseBuild,+Salve.parseConstraint, -- ** Unsafe -- | These functions can be used to unsafely parse strings. Instead of -- returning 'Nothing', they raise an exception. Only use these if you are sure -- the string can be successfully parsed!-unsafeParseVersion,-unsafeParsePreRelease,-unsafeParseBuild,-unsafeParseConstraint,+Salve.unsafeParseVersion,+Salve.unsafeParsePreRelease,+Salve.unsafeParseBuild,+Salve.unsafeParseConstraint, -- * Rendering-renderVersion,-renderPreRelease,-renderBuild,-renderConstraint,+Salve.renderVersion,+Salve.renderPreRelease,+Salve.renderBuild,+Salve.renderConstraint, -- * Predicates-isUnstable,-isStable,+Salve.isUnstable,+Salve.isStable, -- * Conversions-fromBaseVersion,-toBaseVersion,+Salve.fromBaseVersion,+Salve.toBaseVersion, -- * Helpers-bumpMajor,-bumpMinor,-bumpPatch,-satisfiesConstraint,+Salve.bumpMajor,+Salve.bumpMinor,+Salve.bumpPatch,+Salve.satisfiesConstraint, -- * Lenses -- | These lenses can be used to access and modify specific parts of a@@ -199,11 +199,11 @@ -- the @RankNTypes@ language extension. The type signature -- @'Functor' f => (a -> f a) -> 'Version' -> f 'Version'@ is the same as -- @Lens' 'Version' a@, which you may already be familiar with.-majorLens,-minorLens,-patchLens,-preReleasesLens,-buildsLens,+Salve.majorLens,+Salve.minorLens,+Salve.patchLens,+Salve.preReleasesLens,+Salve.buildsLens, -- * Examples -- | These examples are provided to showcase functionality and explain weird@@ -604,7 +604,8 @@ -- True ) where -import Salve.Internal+import qualified Salve.Internal as Salve -- $setup -- >>> import Control.Applicative+-- >>> import Salve
library/Salve/Internal.hs view
@@ -4,7 +4,51 @@ -- | WARNING: This module should be considered private! If you find yourself -- wanting to import something from this module, please open an issue to get -- that thing exported from "Salve".-module Salve.Internal where+module Salve.Internal+ ( Version(..)+ , PreRelease(..)+ , Build(..)+ , Constraint(..)+ , makeVersion+ , initialVersion+ , parseVersion+ , parsePreRelease+ , parseBuild+ , parseConstraint+ , unsafeParseVersion+ , unsafeParsePreRelease+ , unsafeParseBuild+ , unsafeParseConstraint+ , renderVersion+ , renderPreRelease+ , renderBuild+ , renderConstraint+ , isUnstable+ , isStable+ , fromBaseVersion+ , toBaseVersion+ , bumpMajor+ , bumpMinor+ , bumpPatch+ , satisfiesConstraint+ , majorLens+ , minorLens+ , patchLens+ , preReleasesLens+ , buildsLens+ , Operator(..)+ , Wildcard(..)+ , constraintLT+ , constraintLE+ , constraintEQ+ , constraintGE+ , constraintGT+ , constraintAnd+ , constraintOr+ , constraintHyphen+ , constraintTilde+ , constraintCaret+ ) where import qualified Control.Monad as Monad import qualified Data.Char as Char@@ -45,7 +89,7 @@ , versionPatch :: Word.Word64 , versionPreReleases :: [PreRelease] , versionBuilds :: [Build]- } deriving (Data.Data, Eq, Generics.Generic, Read, Show, Data.Typeable)+ } deriving (Data.Data, Eq, Generics.Generic, Read, Show) -- | In general, versions compare in the way that you would expect. First the -- major version numbers are compared, then the minors, then the patches.@@ -108,7 +152,7 @@ data PreRelease = PreReleaseNumeric Word.Word64 | PreReleaseTextual String- deriving (Data.Data, Eq, Generics.Generic, Read, Show, Data.Typeable)+ deriving (Data.Data, Eq, Generics.Generic, Read, Show) -- | Numeric pre-releases are always less than textual pre-releases. --@@ -141,7 +185,7 @@ -- -- Use 'parseBuild' to create builds. newtype Build = Build String- deriving (Data.Data, Eq, Generics.Generic, Read, Show, Data.Typeable)+ deriving (Data.Data, Eq, Generics.Generic, Read, Show) -- | Constrains allowable version numbers. --@@ -153,7 +197,7 @@ | ConstraintWildcard Wildcard | ConstraintAnd Constraint Constraint | ConstraintOr Constraint Constraint- deriving (Data.Data, Eq, Generics.Generic, Ord, Read, Show, Data.Typeable)+ deriving (Data.Data, Eq, Generics.Generic, Ord, Read, Show) -- | Makes a new version number. --@@ -603,13 +647,13 @@ | OperatorGT | OperatorTilde | OperatorCaret- deriving (Data.Data, Eq, Generics.Generic, Ord, Read, Show, Data.Typeable)+ deriving (Data.Data, Eq, Generics.Generic, Ord, Read, Show) data Wildcard = WildcardMajor | WildcardMinor Word.Word64 | WildcardPatch Word.Word64 Word.Word64- deriving (Data.Data, Eq, Generics.Generic, Ord, Read, Show, Data.Typeable)+ deriving (Data.Data, Eq, Generics.Generic, Ord, Read, Show) -- ** Constructors @@ -916,7 +960,7 @@ | SCGT Version | SCAnd SimpleConstraint SimpleConstraint | SCOr SimpleConstraint SimpleConstraint- deriving (Data.Data, Eq, Generics.Generic, Ord, Read, Show, Data.Typeable)+ deriving (Data.Data, Eq, Generics.Generic, Ord, Read, Show) mkV :: Word.Word64 -> Word.Word64 -> Word.Word64 -> Version mkV m n p = makeVersion m n p [] []
+ package.yaml view
@@ -0,0 +1,37 @@+name: salve+version: 1.0.2++category: Distribution+description:+ Salve provides semantic version (SemVer) numbers and constraints (ranges).+extra-source-files:+ - CHANGELOG.markdown+ - package.yaml+ - README.markdown+ - stack.yaml+github: tfausak/salve+license-file: LICENSE.markdown+license: MIT+maintainer: Taylor Fausak+synopsis: Semantic version numbers and constraints.++dependencies:+ base: '>= 4.9.0 && < 4.12'+ghc-options:+ - -Weverything+ - -Wno-implicit-prelude+ - -Wno-safe+ - -Wno-unsafe++library:+ source-dirs: library++tests:+ doctest:+ dependencies:+ doctest: '>= 0.11.0 && < 0.16'+ ghc-options:+ - -rtsopts+ - -threaded+ main: Main.hs+ source-dirs: tests
salve.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 64abeddf64cde776a6bbaae042c6dc3cb37b4f3b59bc9f40b3fb10385fee0de7+-- hash: f3708dd02a35fe7ffbc6b05a8be5c9759450cab1deccae4024ff307340736818 name: salve-version: 1.0.0+version: 1.0.2 synopsis: Semantic version numbers and constraints. description: Salve provides semantic version (SemVer) numbers and constraints (ranges). category: Distribution@@ -19,7 +19,9 @@ extra-source-files: CHANGELOG.markdown+ package.yaml README.markdown+ stack.yaml source-repository head type: git@@ -28,9 +30,9 @@ library hs-source-dirs: library- ghc-options: -Wall+ ghc-options: -Weverything -Wno-implicit-prelude -Wno-safe -Wno-unsafe build-depends:- base >=4.8.2 && <4.11+ base >=4.9.0 && <4.12 exposed-modules: Salve Salve.Internal@@ -43,10 +45,10 @@ main-is: Main.hs hs-source-dirs: tests- ghc-options: -Wall -rtsopts -threaded+ ghc-options: -Weverything -Wno-implicit-prelude -Wno-safe -Wno-unsafe -rtsopts -threaded build-depends:- base >=4.8.2 && <4.11- , doctest >=0.11.2 && <0.14+ base >=4.9.0 && <4.12+ , doctest >=0.11.0 && <0.16 other-modules: Paths_salve default-language: Haskell2010
+ stack.yaml view
@@ -0,0 +1,1 @@+resolver: lts-11.0
tests/Main.hs view
@@ -1,7 +1,7 @@-import Test.DocTest+import qualified Test.DocTest as Doctest main :: IO ()-main = doctest+main = Doctest.doctest [ "library/Salve/Internal.hs" , "library/Salve.hs" ]