Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2265

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Data.Version</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-Version.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">base-4.5.1.0: Basic libraries</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>non-portable (local universal quantification in ReadP)</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">Data.Version</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">The <code>Version</code> type
</a></li><li><a href="#g:2">A concrete representation of <code>Version</code>
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A general library for representation and manipulation of versions.
</p><p>Versioning schemes are many and varied, so the version
 representation provided by this library is intended to be a
 compromise between complete generality, where almost no common
 functionality could reasonably be provided, and fixing a particular
 versioning scheme, which would probably be too restrictive.
</p><p>So the approach taken here is to provide a representation which
 subsumes many of the versioning schemes commonly in use, and we
 provide implementations of <code><a href="Data-Eq.html#t:Eq">Eq</a></code>, <code><a href="Data-Ord.html#t:Ord">Ord</a></code> and conversion to/from <code><a href="Data-String.html#t:String">String</a></code>
 which will be appropriate for some applications, but not all.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <a href="#t:Version">Version</a>  = <a href="#v:Version">Version</a> {<ul class="subs"><li><a href="#v:versionBranch">versionBranch</a> :: [<a href="Data-Int.html#t:Int">Int</a>]</li><li><a href="#v:versionTags">versionTags</a> :: [<a href="Data-String.html#t:String">String</a>]</li></ul>}</li><li class="src short"><a href="#v:showVersion">showVersion</a> :: <a href="Data-Version.html#t:Version">Version</a> -&gt; <a href="Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:parseVersion">parseVersion</a> :: <a href="Text-ParserCombinators-ReadP.html#t:ReadP">ReadP</a> <a href="Data-Version.html#t:Version">Version</a></li></ul></div><div id="interface"><h1 id="g:1">The <code>Version</code> type
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Version" class="def">Version</a>  </p><div class="doc"><p>A <code><a href="Data-Version.html#t:Version">Version</a></code> represents the version of a software entity.  
</p><p>An instance of <code><a href="Data-Eq.html#t:Eq">Eq</a></code> is provided, which implements exact equality
modulo reordering of the tags in the <code><a href="Data-Version.html#v:versionTags">versionTags</a></code> field.
</p><p>An instance of <code><a href="Data-Ord.html#t:Ord">Ord</a></code> is also provided, which gives lexicographic
ordering on the <code><a href="Data-Version.html#v:versionBranch">versionBranch</a></code> fields (i.e. 2.1 &gt; 2.0, 1.2.3 &gt; 1.2.2,
etc.).  This is expected to be sufficient for many uses, but note that
you may need to use a more specific ordering for your versioning
scheme.  For example, some versioning schemes may include pre-releases
which have tags <code>&quot;pre1&quot;</code>, <code>&quot;pre2&quot;</code>, and so on, and these would need to
be taken into account when determining ordering.  In some cases, date
ordering may be more appropriate, so the application would have to
look for <code>date</code> tags in the <code><a href="Data-Version.html#v:versionTags">versionTags</a></code> field and compare those.
The bottom line is, don't always assume that <code><a href="Data-Ord.html#v:compare">compare</a></code> and other <code><a href="Data-Ord.html#t:Ord">Ord</a></code>
operations are the right thing for every <code><a href="Data-Version.html#t:Version">Version</a></code>.
</p><p>Similarly, concrete representations of versions may differ.  One
possible concrete representation is provided (see <code><a href="Data-Version.html#v:showVersion">showVersion</a></code> and
<code><a href="Data-Version.html#v:parseVersion">parseVersion</a></code>), but depending on the application a different concrete
representation may be more appropriate.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Version" class="def">Version</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:versionBranch" class="def">versionBranch</a> :: [<a href="Data-Int.html#t:Int">Int</a>]</dt><dd class="doc"><p>The numeric branch for this version.  This reflects the
 fact that most software versions are tree-structured; there
 is a main trunk which is tagged with versions at various
 points (1,2,3...), and the first branch off the trunk after
 version 3 is 3.1, the second branch off the trunk after
 version 3 is 3.2, and so on.  The tree can be branched
 arbitrarily, just by adding more digits.
</p><p>We represent the branch as a list of <code><a href="Data-Int.html#t:Int">Int</a></code>, so
 version 3.2.1 becomes [3,2,1].  Lexicographic ordering
 (i.e. the default instance of <code><a href="Data-Ord.html#t:Ord">Ord</a></code> for <code>[Int]</code>) gives
 the natural ordering of branches.
</p></dd><dt class="src"><a name="v:versionTags" class="def">versionTags</a> :: [<a href="Data-String.html#t:String">String</a>]</dt><dd class="doc"><p>A version can be tagged with an arbitrary list of strings.
 The interpretation of the list of tags is entirely dependent
 on the entity that this version applies to.
</p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Version" class="caption collapser" onclick="toggleSection('i:Version')">Instances</p><div id="section.i:Version" class="show"><table><tr><td class="src"><a href="Data-Eq.html#t:Eq">Eq</a> <a href="Data-Version.html#t:Version">Version</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Ord.html#t:Ord">Ord</a> <a href="Data-Version.html#t:Version">Version</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-Read.html#t:Read">Read</a> <a href="Data-Version.html#t:Version">Version</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-Show.html#t:Show">Show</a> <a href="Data-Version.html#t:Version">Version</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Typeable-Internal.html#t:Typeable">Typeable</a> <a href="Data-Version.html#t:Version">Version</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h1 id="g:2">A concrete representation of <code>Version</code>
</h1><div class="top"><p class="src"><a name="v:showVersion" class="def">showVersion</a> :: <a href="Data-Version.html#t:Version">Version</a> -&gt; <a href="Data-String.html#t:String">String</a></p><div class="doc"><p>Provides one possible concrete representation for <code><a href="Data-Version.html#t:Version">Version</a></code>.  For
 a version with <code><a href="Data-Version.html#v:versionBranch">versionBranch</a></code> <code>= [1,2,3]</code> and <code><a href="Data-Version.html#v:versionTags">versionTags</a></code> 
 <code>= [&quot;tag1&quot;,&quot;tag2&quot;]</code>, the output will be <code>1.2.3-tag1-tag2</code>.
</p></div></div><div class="top"><p class="src"><a name="v:parseVersion" class="def">parseVersion</a> :: <a href="Text-ParserCombinators-ReadP.html#t:ReadP">ReadP</a> <a href="Data-Version.html#t:Version">Version</a></p><div class="doc"><p>A parser for versions in the format produced by <code><a href="Data-Version.html#v:showVersion">showVersion</a></code>.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>