úÎC?G,      !"#$%&'()*+(c) Colin Woodbury, 2015BSD3"Colin Woodbury <colingw@gmail.com>None“A wrapper for a parser function. Can be composed via their Semigroup instance, such that a different parser can be tried if a previous one fails.mDevelopers use a number of symbols to seperate groups of digits/letters in their version numbers. These are:&A colon (:). Often denotes an "epoch". A hyphen (-).EA plus (+). Stop using this outside of metadata if you are. Example:  10.2+0.93+1-1.An underscore (_). Stop using this if you are.A (Complex) Mess. This is a  descriptiveQ parser, based on examples of stupidly crafted version numbers used in the wild.[Groups of letters/numbers, separated by a period, can be further separated by the symbols _-+:Unfortunately, VChunk=s cannot be used here, as some developers have numbers like 1.003.04 which make parsers quite sad..Not guaranteed to have well-defined ordering (Ord8) behaviour, but so far interal tests show consistency. .A (General) Version. Not quite as ideal as a Y, but has some internal consistancy from version to version. Generally conforms to the x.x.x-x pattern. Examples of Version that are not SemVer: 0.25-2, 8.u51-1, 20150826-1QA logical unit of a version number. Can consist of multiple letters and numbers.aA single unit of a Version. May be digits or a string of characters. Groups of these are called ?s, and are the identifiers separated by periods in the source.KAn (Ideal) version number that conforms to Semantic Versioning. This is a  prescriptive0 parser, meaning it follows the SemVer standard.<Legal semvers are of the form: MAJOR.MINOR.PATCH-PREREL+METAExample: 1.2.3-r1+commithash Extra Rules: Pre-release versions have lower! precedence than normal versions.2Build metadata does not affect version precedence.For more information, see http://semver.orgôA top-level Versioning type. Acts as a wrapper for the more specific types. This allows each subtype to have its own parser, and for said parsers to be composed. This is useful for specifying custom behaviour for when a certain parser fails., Convert a  to a  .- Convert a   to a .Parse a piece of TextJ into either an (Ideal) SemVer, a (General) Version, or a (Complex) Mess. A wrapped , parser. Can be composed with other parsers. !Parse a (Ideal) Semantic Version.!-Parse a Semantic Version, as a legacy String..DParse a group of digits, which can't be lead by a 0, unless it is 0." A wrapped  , parser. Can be composed with other parsers.#Parse a (General)  , as defined above.$Parse a  %, where the input is a legacy String.% A wrapped , parser. Can be composed with other parsers.&Parse a (Complex) , as defined above. 'Parse a %, where the input is a legacy String.(AConvert any parsed Versioning type to its textual representation.) Convert a $ back to its textual representation.* Convert a  $ back to its textual representation.+ Convert a $ back to its textual representation./ Analogous to 0 and 1k. If a given Foldable is empty, a default value is returned. Else, a function is applied to that Foldable.2Flip an Ordering.32Build metadata does not affect version precedence.4>Two SemVers are equal if all fields except metadata are equal.5Comparison of Ideals is always well defined.If comparison of General's is well-defined, then comparison of Ideal and General: is well-defined, as there exists a perfect mapping from Ideal to General.If comparison of Complex'es is well-defined, then comparison of General and ComplexB is well defined for the same reason. This implies comparison of Ideal and Complex is also well-defined.H 6,- !7.89:;<=>?"#$@%&'ABCDEF()*+G/2HI345,  !"#$%&'()*+,   !#$&'"%()*+2  6,- !7.89:;<=>?"#$@%&'ABCDEF()*+G/2HI345J       !"#$%&'()*+,-./01/23456789:;<=>?@ABCDEFGHIJKLversi_Ia6fDSf5ViSI6y5yuI7bNo Data.VersionsVParserrunVPVSepVColonVHyphenVPlusVUnderMessVLeafVNodeVersionvChunksvRelVChunkVUnitDigitsStrSemVersvMajorsvMinorsvPatchsvPreRelsvMeta VersioningIdealGeneralComplexparseVsemverPsemversemver'versionPversionversion'messPmessmess'prettyV prettySemVer prettyVer prettyMessvFromSmFromVdigitsfoldablebase Data.Maybemaybe Data.Eithereitheropposite $fOrdSemVer $fEqSemVer$fOrdVersioningcmpSVsemanticVersionmajorminorpatchpreRelmetaDatachunksiunitsunit versionNum messNumberleafnodetchunkssepsepCh chunksAsT$fSemigroupVParser $fOrdMess