-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Representation, manipulation, and de/serialisation of Semantic Versions. -- @package semver @version 0.3.3 -- | A set of delimiters can be used to encode/decode a Version and -- specify alternative serialisation strategies. -- -- Lenses can be used to modify the default delimiter set, as in the -- following example - using alpha characters to encode the version as a -- valid DNS CNAME (assuming operators from lens or lens-family-core): -- --
--   let Right v = fromText "1.2.3+40"
--   let alpha = semantic & major .~ 'm' & patch .~ 'p' & release .~ 'r' & metadata .~ 'd' & identifier .~ 'i'
--   
--   Data.Text.Lazy.Builder.toLazyText ("app01-" <> toBuilder alpha v <> ".dmz.internal")
--   
-- -- Would result in the following Text: -- --
--   app01-1m2p3d40.dmz.internal
--   
-- -- Using the same Delimiters set with parser would ensure -- correct decoding behaviour. module Data.SemVer.Delimited -- | An opaque set representing the seperators used to delimit semantic -- version components. data Delimiters -- | The default set of delimiters used in the semantic version -- specification. -- -- Example: Given exhaustive version components would result in the -- following hypothetical version: -- --
--   1.2.3-alpha.1+sha.exp.12ab3d9
--   
semantic :: Delimiters -- | Lens for the minor version delimiter. Default: . minor :: Functor f => (Char -> f Char) -> Delimiters -> f Delimiters -- | Lens for the patch version delimiter. Default: . patch :: Functor f => (Char -> f Char) -> Delimiters -> f Delimiters -- | Lens for the release component delimiter. Default: - release :: Functor f => (Char -> f Char) -> Delimiters -> f Delimiters -- | Lens for the metadata component delimiter. Default: + metadata :: Functor f => (Char -> f Char) -> Delimiters -> f Delimiters -- | Lens for the individual identifier delimiter. Default: . identifier :: Functor f => (Char -> f Char) -> Delimiters -> f Delimiters -- | Convert a Version to a Builder using the specified -- Delimiters set. toBuilder :: Delimiters -> Version -> Builder -- | A greedy attoparsec Parser using the specified -- Delimiters set which requires the entire Text input to -- match. parser :: Delimiters -> Parser Version -- | An implementation of the Semantic Versioning specification located at -- http://semver.org. -- -- A canonical Version type and functions representing behaviour -- as outlined in the specification are defined alongside additional -- lenses, traversals, common manipulations, and serialisation -- primitives. module Data.SemVer -- | An opaque type representing a successfully decoded or constructed -- semantic version. See the related functions and lenses for -- modification and update. -- -- data Version -- | Smart constructor fully specifying all available version components. version :: Int -> Int -> Int -> [Identifier] -> [Identifier] -> Version -- | A default Version which can be used to signify initial -- development. -- -- Note: Equivalent to 0.0.0 initial :: Version -- | Lens for the major version component. major :: Functor f => (Int -> f Int) -> Version -> f Version -- | Lens for minor version component. minor :: Functor f => (Int -> f Int) -> Version -> f Version -- | Lens for the patch version component. patch :: Functor f => (Int -> f Int) -> Version -> f Version -- | Lens for the list of release identifiers. release :: Functor f => ([Identifier] -> f [Identifier]) -> Version -> f Version -- | Lens for the list of metadata identifiers. metadata :: Functor f => ([Identifier] -> f [Identifier]) -> Version -> f Version -- | Increment the major component of a Version by 1, resetting the -- minor and patch components. -- -- incrementMajor :: Version -> Version -- | Increment the minor component of a Version by 1, resetting the -- patch component. -- -- incrementMinor :: Version -> Version -- | Increment the patch component of a Version by 1. -- -- incrementPatch :: Version -> Version -- | Check if the Version is considered unstable. -- -- isDevelopment :: Version -> Bool -- | Check if the Version is considered stable. -- -- Version 1.0.0 defines the public API. The way in which the version -- number is incremented after this release is dependent on this public -- API and how it changes. isPublic :: Version -> Bool -- | Convert a Version to it's readable String -- representation. -- -- Note: This is optimised for cases where you require String -- output, and as such is faster than the semantically equivalent -- unpack . toLazyText. toString :: Version -> String -- | Convert a Version to a strict Text representation. -- -- Note: Equivalent to toStrict . toLazyText toText :: Version -> Text -- | Convert a Version to a Text representation. -- -- Note: This uses a lower Builder buffer size optimised for -- commonly found version formats. If you have particuarly long version -- numbers using toBuilder and toLazyTextWith to control -- the buffer size is recommended. toLazyText :: Version -> Text -- | Convert a Version to a Builder. toBuilder :: Version -> Builder -- | Parse a Version from Text, returning an attoparsec error -- message in the Left case on failure. fromText :: Text -> Either String Version -- | Parse a Version from Text, returning an attoparsec error -- message in the Left case on failure. -- -- Note: The underlying attoparsec Parser is based on Text -- and this is equivalent to fromText . toStrict fromLazyText :: Text -> Either String Version -- | A greedy attoparsec Parser which requires the entire -- Text input to match. parser :: Parser Version -- | A type representing an individual identifier from the release or -- metadata components of a Version. -- -- -- -- The functions numeric and textual can be used to -- construct an Identifier. data Identifier -- | Safely construct a numeric identifier. numeric :: Int -> Identifier -- | Construct an identifier from the given Text, returning -- Nothing if neither a numeric or valid textual input is -- supplied. textual :: Text -> Maybe Identifier -- | A prism into the numeric branch of an Identifier. _Numeric :: Applicative f => (Int -> f Int) -> Identifier -> f Identifier -- | A prism into the textual branch of an Identifier. _Textual :: Applicative f => (Text -> f Text) -> Identifier -> f (Maybe Identifier)