packages feed

semver 0.1.0 → 0.1.1

raw patch · 2 files changed

+12/−9 lines, 2 files

Files

semver.cabal view
@@ -1,5 +1,5 @@ name:                  semver-version:               0.1.0+version:               0.1.1 synopsis:              Representation, manipulation, and de/serialisation of Semantic Versions. homepage:              https://github.com/brendanhay/semver license:               OtherLicense
src/Data/SemVer.hs view
@@ -94,7 +94,7 @@ -- or metadata components of a 'Version'. -- -- * The 'Ord' instance implements precedence according to the semantic version--- specification, with numeric identifiers being of _lower_ precedence than+-- specification, with numeric identifiers being of /lower/ precedence than -- textual identifiers, otherwise lexicographic ordering is used. data Identifier     = INum  !Int@@ -121,6 +121,7 @@ -- -- * The 'Eq' instance represents exhaustive equality with all -- components considered.+-- -- * The 'Ord' instance implements the precedence rules from the semantic -- version specification with metadata ('_versionMeta') being ignored. data Version = Version@@ -138,7 +139,7 @@  -- | A default 'Version' which can be used to signify initial development. ----- __Note:__ Equivalent to @0.0.0@+-- Note: Equivalent to @0.0.0@ defaultVersion :: Version defaultVersion = Version 0 0 0 [] [] @@ -188,7 +189,7 @@ -- | A set of delimiters used to encode/decode a 'Version' and specifyc -- alternative serialisation strategies. ----- __Example:__ using alpha characters to encode the version as a valid+-- Example: using alpha characters to encode the version as a valid -- DNS CNAME, such as: -- -- @@@ -216,7 +217,7 @@  -- | The default set of delimiters used in the semantic version specification. ----- __Example:__ Given exhaustive version components would result in the+-- Example: Given exhaustive version components would result in the -- following hypothetical version: -- -- @@@ -311,7 +312,9 @@ -- | Check if the 'Version' is considered unstable. -- -- * Major version zero (0.y.z) is for initial development.+-- -- * Anything may change at any time.+-- -- * The public API should not be considered stable. isDevelopment :: Version -> Bool isDevelopment = (== 0) . _versionMajor@@ -326,20 +329,20 @@  -- | Convert a 'Version' to it's readable 'String' representation. ----- __Note:__ This is optimised for cases where you wish to use a 'String' and+-- Note: This is optimised for cases where you wish to use a 'String' and -- as such is faster than the semantically equivalent @unpack . toLazyText@. toString :: Version -> String toString = toMonoid (:[]) show Text.unpack defaultDelimiters  -- | Convert a 'Version' to a strict 'Text' representation. ----- __Note:__ Equivalent to @toStrict . toLazyText@+-- Note: Equivalent to @toStrict . toLazyText@ toText :: Version -> Text toText = LText.toStrict . toLazyText  -- | Convert a 'Version' to a 'LText.Text' representation. ----- __Note:__ This uses a lower 'Builder' buffer size optimised for commonly+-- Note: This uses a lower 'Builder' buffer size optimised for commonly -- found version formats. If you have particuarly long version numbers -- using 'toBuilder' and 'Build.toLazyTextWith' to control the buffer size -- is recommended.@@ -386,7 +389,7 @@ -- | Parse a 'Version' from 'LText.Text', returning an attoparsec error message -- in the 'Left' case on failure. ----- __Note:__ The underlying attoparsec 'Parser' is based on 'Text' and this is+-- Note: The underlying attoparsec 'Parser' is based on 'Text' and this is -- equivalent to @fromText . toStrict@ fromLazyText :: LText.Text -> Either String Version fromLazyText = fromText . LText.toStrict