Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 040b01fd062be0d3984f68287bae0bc8 > files > 183

ghc-Cabal-devel-1.8.0.6-8.6.fc14.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--Rendered using the Haskell Html Library v0.2-->
<HTML
><HEAD
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>Distribution.Version</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
><SCRIPT SRC="haddock-util.js" TYPE="text/javascript"
></SCRIPT
><SCRIPT TYPE="text/javascript"
>window.onload = function () {setSynopsis("mini_Distribution-Version.html")};</SCRIPT
></HEAD
><BODY
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topbar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" "
></TD
><TD CLASS="title"
>Cabal-1.8.0.6: A framework for packaging Haskell software</TD
><TD CLASS="topbut"
><A HREF="index.html"
>Contents</A
></TD
><TD CLASS="topbut"
><A HREF="doc-index.html"
>Index</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="modulebar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><FONT SIZE="6"
>Distribution.Version</FONT
></TD
><TD ALIGN="right"
><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="infohead"
>Portability</TD
><TD CLASS="infoval"
>portable</TD
></TR
><TR
><TD CLASS="infohead"
>Maintainer</TD
><TD CLASS="infoval"
>cabal-devel@haskell.org</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
><B
>Contents</B
></TD
></TR
><TR
><TD
><DL
><DT
><A HREF="#1"
>Package versions
</A
></DT
><DT
><A HREF="#2"
>Version ranges
</A
></DT
><DD
><DL
><DT
><A HREF="#3"
>Constructing
</A
></DT
><DT
><A HREF="#4"
>Inspection
</A
></DT
></DL
></DD
><DT
><A HREF="#5"
>Version intervals view
</A
></DT
><DD
><DL
><DT
><A HREF="#6"
><TT
><A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TT
> abstract type
</A
></DT
></DL
></DD
></DL
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Description</TD
></TR
><TR
><TD CLASS="doc"
>Exports the <TT
><A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TT
> type along with a parser and pretty printer. A version
 is something like <TT
>&quot;1.3.3&quot;</TT
>. It also defines the <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
> data
 types. Version ranges are like <TT
>&quot;&gt;= 1.2 &amp;&amp; &lt; 2&quot;</TT
>.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Synopsis</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3AVersion"
>Version</A
>  = <A HREF="#v%3AVersion"
>Version</A
> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="recfield"
><A HREF="#v%3AversionBranch"
>versionBranch</A
> :: [<A HREF="../base-4.2.0.2/Data-Int.html#t%3AInt"
>Int</A
>]</TD
></TR
><TR
><TD CLASS="recfield"
><A HREF="#v%3AversionTags"
>versionTags</A
> :: [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
>]</TD
></TR
></TABLE
>}</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3AVersionRange"
>VersionRange</A
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
>= <A HREF="#v%3AAnyVersion"
>AnyVersion</A
></TD
></TR
><TR
><TD CLASS="decl"
>| <A HREF="#v%3AThisVersion"
>ThisVersion</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="decl"
>| <A HREF="#v%3ALaterVersion"
>LaterVersion</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="decl"
>| <A HREF="#v%3AEarlierVersion"
>EarlierVersion</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="decl"
>| <A HREF="#v%3AWildcardVersion"
>WildcardVersion</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="decl"
>| <A HREF="#v%3AUnionVersionRanges"
>UnionVersionRanges</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="decl"
>| <A HREF="#v%3AIntersectVersionRanges"
>IntersectVersionRanges</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AanyVersion"
>anyVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AnoVersion"
>noVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AthisVersion"
>thisVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AnotThisVersion"
>notThisVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AlaterVersion"
>laterVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AearlierVersion"
>earlierVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AorLaterVersion"
>orLaterVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AorEarlierVersion"
>orEarlierVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AunionVersionRanges"
>unionVersionRanges</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AintersectVersionRanges"
>intersectVersionRanges</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwithinVersion"
>withinVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AbetweenVersionsInclusive"
>betweenVersionsInclusive</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwithinRange"
>withinRange</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisAnyVersion"
>isAnyVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisNoVersion"
>isNoVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisSpecificVersion"
>isSpecificVersion</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsimplifyVersionRange"
>simplifyVersionRange</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AfoldVersionRange"
>foldVersionRange</A
> ::  a -&gt; (<A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a) -&gt; (<A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a) -&gt; (<A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a) -&gt; (a -&gt; a -&gt; a) -&gt; (a -&gt; a -&gt; a) -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AfoldVersionRange%27"
>foldVersionRange'</A
> ::  a -&gt; (<A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a) -&gt; (<A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a) -&gt; (<A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a) -&gt; (<A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a) -&gt; (<A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a) -&gt; (<A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a) -&gt; (a -&gt; a -&gt; a) -&gt; (a -&gt; a -&gt; a) -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AasVersionIntervals"
>asVersionIntervals</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; [<A HREF="Distribution-Version.html#t%3AVersionInterval"
>VersionInterval</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A HREF="#t%3AVersionInterval"
>VersionInterval</A
> = (<A HREF="Distribution-Version.html#t%3ALowerBound"
>LowerBound</A
>, <A HREF="Distribution-Version.html#t%3AUpperBound"
>UpperBound</A
>)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3ALowerBound"
>LowerBound</A
>  = <A HREF="#v%3ALowerBound"
>LowerBound</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> !<A HREF="Distribution-Version.html#t%3ABound"
>Bound</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3AUpperBound"
>UpperBound</A
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
>= <A HREF="#v%3ANoUpperBound"
>NoUpperBound</A
></TD
></TR
><TR
><TD CLASS="decl"
>| <A HREF="#v%3AUpperBound"
>UpperBound</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> !<A HREF="Distribution-Version.html#t%3ABound"
>Bound</A
></TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3ABound"
>Bound</A
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
>= <A HREF="#v%3AExclusiveBound"
>ExclusiveBound</A
></TD
></TR
><TR
><TD CLASS="decl"
>| <A HREF="#v%3AInclusiveBound"
>InclusiveBound</A
></TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3AVersionIntervals"
>VersionIntervals</A
> </TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtoVersionIntervals"
>toVersionIntervals</A
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AfromVersionIntervals"
>fromVersionIntervals</A
> :: <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AwithinIntervals"
>withinIntervals</A
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AversionIntervals"
>versionIntervals</A
> :: <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; [<A HREF="Distribution-Version.html#t%3AVersionInterval"
>VersionInterval</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkVersionIntervals"
>mkVersionIntervals</A
> :: [<A HREF="Distribution-Version.html#t%3AVersionInterval"
>VersionInterval</A
>] -&gt; <A HREF="../base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AunionVersionIntervals"
>unionVersionIntervals</A
> :: <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AintersectVersionIntervals"
>intersectVersionIntervals</A
> :: <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="1"
><A NAME="1"
>Package versions
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:Version"
><A NAME="t%3AVersion"
></A
></A
><B
>Version</B
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
><P
>A <TT
><A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TT
> represents the version of a software entity.  
</P
><P
>An instance of <TT
><A HREF="../base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
></TT
> is provided, which implements exact equality
modulo reordering of the tags in the <TT
><A HREF="Distribution-Version.html#v%3AversionTags"
>versionTags</A
></TT
> field.
</P
><P
>An instance of <TT
><A HREF="../base-4.2.0.2/Data-Ord.html#t%3AOrd"
>Ord</A
></TT
> is also provided, which gives lexicographic
ordering on the <TT
><A HREF="Distribution-Version.html#v%3AversionBranch"
>versionBranch</A
></TT
> 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 <TT
>&quot;pre1&quot;</TT
>, <TT
>&quot;pre2&quot;</TT
>, 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 <TT
>date</TT
> tags in the <TT
><A HREF="Distribution-Version.html#v%3AversionTags"
>versionTags</A
></TT
> field and compare those.
The bottom line is, don't always assume that <TT
><A HREF="../base-4.2.0.2/Data-Ord.html#v%3Acompare"
>compare</A
></TT
> and other <TT
><A HREF="../base-4.2.0.2/Data-Ord.html#t%3AOrd"
>Ord</A
></TT
>
operations are the right thing for every <TT
><A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TT
>.
</P
><P
>Similarly, concrete representations of versions may differ.  One
possible concrete representation is provided (see <TT
><A HREF="../base-4.2.0.2/Data-Version.html#v%3AshowVersion"
>showVersion</A
></TT
> and
<TT
><A HREF="../base-4.2.0.2/Data-Version.html#v%3AparseVersion"
>parseVersion</A
></TT
>), but depending on the application a different concrete
representation may be more appropriate.
</P
></TD
></TR
><TR
><TD CLASS="section4"
>Constructors</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:Version"
><A NAME="v%3AVersion"
></A
></A
><B
>Version</B
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="body" COLSPAN="2"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:versionBranch"
><A NAME="v%3AversionBranch"
></A
></A
><B
>versionBranch</B
> :: [<A HREF="../base-4.2.0.2/Data-Int.html#t%3AInt"
>Int</A
>]</TD
><TD CLASS="rdoc"
><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 <TT
><A HREF="../base-4.2.0.2/Data-Int.html#t%3AInt"
>Int</A
></TT
>, so
 version 3.2.1 becomes [3,2,1].  Lexicographic ordering
 (i.e. the default instance of <TT
><A HREF="../base-4.2.0.2/Data-Ord.html#t%3AOrd"
>Ord</A
></TT
> for <TT
>[Int]</TT
>) gives
 the natural ordering of branches.
</P
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:versionTags"
><A NAME="v%3AversionTags"
></A
></A
><B
>versionTags</B
> :: [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
>]</TD
><TD CLASS="rdoc"
>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.
</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Version')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:Version" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Ord.html#t%3AOrd"
>Ord</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Text-Read.html#t%3ARead"
>Read</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Typeable.html#t%3ATypeable"
>Typeable</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Distribution-Text.html#t%3AText"
>Text</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="2"
><A NAME="2"
>Version ranges
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:VersionRange"
><A NAME="t%3AVersionRange"
></A
></A
><B
>VersionRange</B
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
>Constructors</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:AnyVersion"
><A NAME="v%3AAnyVersion"
></A
></A
><B
>AnyVersion</B
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:ThisVersion"
><A NAME="v%3AThisVersion"
></A
></A
><B
>ThisVersion</B
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:LaterVersion"
><A NAME="v%3ALaterVersion"
></A
></A
><B
>LaterVersion</B
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:EarlierVersion"
><A NAME="v%3AEarlierVersion"
></A
></A
><B
>EarlierVersion</B
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:WildcardVersion"
><A NAME="v%3AWildcardVersion"
></A
></A
><B
>WildcardVersion</B
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:UnionVersionRanges"
><A NAME="v%3AUnionVersionRanges"
></A
></A
><B
>UnionVersionRanges</B
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:IntersectVersionRanges"
><A NAME="v%3AIntersectVersionRanges"
></A
></A
><B
>IntersectVersionRanges</B
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
><TD CLASS="rdoc"
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:VersionRange')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:VersionRange" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Text-Read.html#t%3ARead"
>Read</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Distribution-Text.html#t%3AText"
>Text</A
> <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="3"
><A NAME="3"
>Constructing
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:anyVersion"
><A NAME="v%3AanyVersion"
></A
></A
><B
>anyVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>-any</TT
>. That is, a version range containing all
 versions.
</P
><PRE
> withinRange v anyVersion = True
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:noVersion"
><A NAME="v%3AnoVersion"
></A
></A
><B
>noVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The empty version range, that is a version range containing no versions.
</P
><P
>This can be constructed using any unsatisfiable version range expression,
 for example <TT
>&gt; 1 &amp;&amp; &lt; 1</TT
>.
</P
><PRE
> withinRange v anyVersion = False
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:thisVersion"
><A NAME="v%3AthisVersion"
></A
></A
><B
>thisVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>== v</TT
>
</P
><PRE
> withinRange v' (thisVersion v) = v' == v
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:notThisVersion"
><A NAME="v%3AnotThisVersion"
></A
></A
><B
>notThisVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
><A HREF=" v || "
> v || </A
> v</TT
>
</P
><PRE
> withinRange v' (notThisVersion v) = v' /= v
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:laterVersion"
><A NAME="v%3AlaterVersion"
></A
></A
><B
>laterVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>&gt; v</TT
>
</P
><PRE
> withinRange v' (laterVersion v) = v' &gt; v
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:earlierVersion"
><A NAME="v%3AearlierVersion"
></A
></A
><B
>earlierVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>&lt; v</TT
>
</P
><PRE
> withinRange v' (earlierVersion v) = v' &lt; v
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:orLaterVersion"
><A NAME="v%3AorLaterVersion"
></A
></A
><B
>orLaterVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>&gt;= v</TT
>
</P
><PRE
> withinRange v' (orLaterVersion v) = v' &gt;= v
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:orEarlierVersion"
><A NAME="v%3AorEarlierVersion"
></A
></A
><B
>orEarlierVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>&lt;= v</TT
>
</P
><PRE
> withinRange v' (orEarlierVersion v) = v' &lt;= v
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:unionVersionRanges"
><A NAME="v%3AunionVersionRanges"
></A
></A
><B
>unionVersionRanges</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>vr1 || vr2</TT
>
</P
><PRE
>   withinRange v' (unionVersionRanges vr1 vr2)
 = withinRange v' vr1 || withinRange v' vr2
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:intersectVersionRanges"
><A NAME="v%3AintersectVersionRanges"
></A
></A
><B
>intersectVersionRanges</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>vr1 &amp;&amp; vr2</TT
>
</P
><PRE
>   withinRange v' (intersectVersionRanges vr1 vr2)
 = withinRange v' vr1 &amp;&amp; withinRange v' vr2
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:withinVersion"
><A NAME="v%3AwithinVersion"
></A
></A
><B
>withinVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>== v.*</TT
>.
</P
><P
>For example, for version <TT
>1.2</TT
>, the version range <TT
>== 1.2.*</TT
> is the same as
 <TT
>&gt;= 1.2 &amp;&amp; &lt; 1.3</TT
>
</P
><PRE
> withinRange v' (laterVersion v) = v' &gt;= v &amp;&amp; v' &lt; upper v
   where
     upper (Version lower t) = Version (init lower ++ [last lower + 1]) t
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:betweenVersionsInclusive"
><A NAME="v%3AbetweenVersionsInclusive"
></A
></A
><B
>betweenVersionsInclusive</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The version range <TT
>&gt;= v1 &amp;&amp; &lt;= v2</TT
>.
</P
><P
>In practice this is not very useful because we normally use inclusive lower
 bounds and exclusive upper bounds.
</P
><PRE
> withinRange v' (laterVersion v) = v' &gt; v
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="4"
><A NAME="4"
>Inspection
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:withinRange"
><A NAME="v%3AwithinRange"
></A
></A
><B
>withinRange</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Does this version fall within the given range?
</P
><P
>This is the evaluation function for the <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
> type.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isAnyVersion"
><A NAME="v%3AisAnyVersion"
></A
></A
><B
>isAnyVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Does this <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
> place any restriction on the <TT
><A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TT
> or is it
 in fact equivalent to <TT
><A HREF="Distribution-Version.html#v%3AAnyVersion"
>AnyVersion</A
></TT
>.
</P
><P
>Note this is a semantic check, not simply a syntactic check. So for example
 the following is <TT
>True</TT
> (for all <TT
>v</TT
>).
</P
><PRE
> isAnyVersion (EarlierVersion v `UnionVersionRanges` orLaterVersion v)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isNoVersion"
><A NAME="v%3AisNoVersion"
></A
></A
><B
>isNoVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>This is the converse of <TT
><A HREF="Distribution-Version.html#v%3AisAnyVersion"
>isAnyVersion</A
></TT
>. It check if the version range is
 empty, if there is no possible version that satisfies the version range.
</P
><P
>For example this is <TT
>True</TT
> (for all <TT
>v</TT
>):
</P
><PRE
> isNoVersion (EarlierVersion v `IntersectVersionRanges` LaterVersion v)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isSpecificVersion"
><A NAME="v%3AisSpecificVersion"
></A
></A
><B
>isSpecificVersion</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Is this version range in fact just a specific version?
</P
><P
>For example the version range <TT
>&quot;&gt;= 3 &amp;&amp; &lt;= 3&quot;</TT
> contains only the version
 <TT
>3</TT
>.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:simplifyVersionRange"
><A NAME="v%3AsimplifyVersionRange"
></A
></A
><B
>simplifyVersionRange</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Simplify a <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
> expression. For non-empty version ranges
 this produces a canonical form. Empty or inconsistent version ranges
 are left as-is because that provides more information.
</P
><P
>If you need a canonical form use
 <TT
>fromVersionIntervals . toVersionIntervals</TT
>
</P
><P
>It satisfies the following properties:
</P
><PRE
> withinRange v (simplifyVersionRange r) = withinRange v r
</PRE
><PRE
>     withinRange v r = withinRange v r'
 ==&gt; simplifyVersionRange r = simplifyVersionRange r'
  || isNoVersion r
  || isNoVersion r'
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:foldVersionRange"
><A NAME="v%3AfoldVersionRange"
></A
></A
><B
>foldVersionRange</B
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: a</TD
><TD CLASS="rdoc"
><TT
>&quot;-any&quot;</TT
> version
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a</TD
><TD CLASS="rdoc"
><PRE
>&quot;== v&quot;</PRE
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a</TD
><TD CLASS="rdoc"
><PRE
>&quot;&gt; v&quot;</PRE
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a</TD
><TD CLASS="rdoc"
><PRE
>&quot;&lt; v&quot;</PRE
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; a -&gt; a -&gt; a</TD
><TD CLASS="rdoc"
><TT
>&quot;_ || _&quot;</TT
> union
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; a -&gt; a -&gt; a</TD
><TD CLASS="rdoc"
><TT
>&quot;_ &amp;&amp; _&quot;</TT
> intersection
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; a</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
><P
>Fold over the basic syntactic structure of a <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
>.
</P
><P
>This provides a syntacic view of the expression defining the version range.
 The syntactic sugar <TT
>&quot;&gt;= v&quot;</TT
>, <TT
>&quot;&lt;= v&quot;</TT
> and <TT
>&quot;== v.*&quot;</TT
> is presented
 in terms of the other basic syntax.
</P
><P
>For a semantic view use <TT
><A HREF="Distribution-Version.html#v%3AasVersionIntervals"
>asVersionIntervals</A
></TT
>.
</P
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:foldVersionRange'"
><A NAME="v%3AfoldVersionRange%27"
></A
></A
><B
>foldVersionRange'</B
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: a</TD
><TD CLASS="rdoc"
><TT
>&quot;-any&quot;</TT
> version
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a</TD
><TD CLASS="rdoc"
><PRE
>&quot;== v&quot;</PRE
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a</TD
><TD CLASS="rdoc"
><PRE
>&quot;&gt; v&quot;</PRE
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a</TD
><TD CLASS="rdoc"
><PRE
>&quot;&lt; v&quot;</PRE
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a</TD
><TD CLASS="rdoc"
><PRE
>&quot;&gt;= v&quot;</PRE
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a</TD
><TD CLASS="rdoc"
><PRE
>&quot;&lt;= v&quot;</PRE
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; a</TD
><TD CLASS="rdoc"
><TT
>&quot;== v.*&quot;</TT
> wildcard. The
 function is passed the
 inclusive lower bound and the
 exclusive upper bounds of the
 range defined by the wildcard.
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; a -&gt; a -&gt; a</TD
><TD CLASS="rdoc"
><TT
>&quot;_ || _&quot;</TT
> union
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; a -&gt; a -&gt; a</TD
><TD CLASS="rdoc"
><TT
>&quot;_ &amp;&amp; _&quot;</TT
> intersection
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; a</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
>An extended variant of <TT
><A HREF="Distribution-Version.html#v%3AfoldVersionRange"
>foldVersionRange</A
></TT
> that also provides a view of
 in which the syntactic sugar <TT
>&quot;&gt;= v&quot;</TT
>, <TT
>&quot;&lt;= v&quot;</TT
> and <TT
>&quot;== v.*&quot;</TT
> is presented
 explicitly rather than in terms of the other basic syntax.
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="5"
><A NAME="5"
>Version intervals view
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:asVersionIntervals"
><A NAME="v%3AasVersionIntervals"
></A
></A
><B
>asVersionIntervals</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; [<A HREF="Distribution-Version.html#t%3AVersionInterval"
>VersionInterval</A
>]</TD
></TR
><TR
><TD CLASS="doc"
><P
>View a <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
> as a union of intervals.
</P
><P
>This provides a canonical view of the semantics of a <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
> as
 opposed to the syntax of the expression used to define it. For the syntactic
 view use <TT
><A HREF="Distribution-Version.html#v%3AfoldVersionRange"
>foldVersionRange</A
></TT
>.
</P
><P
>Each interval is non-empty. The sequence is in increasing order and no
 intervals overlap or touch. Therefore only the first and last can be
 unbounded. The sequence can be empty if the range is empty
 (e.g. a range expression like <TT
><A HREF=" 1 && "
> 1 &amp;&amp; </A
> 2</TT
>).
</P
><P
>Other checks are trivial to implement using this view. For example:
</P
><PRE
> isNoVersion vr | [] &lt;- asVersionIntervals vr = True
                | otherwise                   = False
</PRE
><PRE
> isSpecificVersion vr
    | [(LowerBound v  InclusiveBound
       ,UpperBound v' InclusiveBound)] &lt;- asVersionIntervals vr
    , v == v'   = Just v
    | otherwise = Nothing
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A NAME="t:VersionInterval"
><A NAME="t%3AVersionInterval"
></A
></A
><B
>VersionInterval</B
> = (<A HREF="Distribution-Version.html#t%3ALowerBound"
>LowerBound</A
>, <A HREF="Distribution-Version.html#t%3AUpperBound"
>UpperBound</A
>)</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:LowerBound"
><A NAME="t%3ALowerBound"
></A
></A
><B
>LowerBound</B
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
>Constructors</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:LowerBound"
><A NAME="v%3ALowerBound"
></A
></A
><B
>LowerBound</B
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> !<A HREF="Distribution-Version.html#t%3ABound"
>Bound</A
></TD
><TD CLASS="rdoc"
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:LowerBound')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:LowerBound" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
> <A HREF="Distribution-Version.html#t%3ALowerBound"
>LowerBound</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Ord.html#t%3AOrd"
>Ord</A
> <A HREF="Distribution-Version.html#t%3ALowerBound"
>LowerBound</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> <A HREF="Distribution-Version.html#t%3ALowerBound"
>LowerBound</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:UpperBound"
><A NAME="t%3AUpperBound"
></A
></A
><B
>UpperBound</B
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
>Constructors</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:NoUpperBound"
><A NAME="v%3ANoUpperBound"
></A
></A
><B
>NoUpperBound</B
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:UpperBound"
><A NAME="v%3AUpperBound"
></A
></A
><B
>UpperBound</B
> <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> !<A HREF="Distribution-Version.html#t%3ABound"
>Bound</A
></TD
><TD CLASS="rdoc"
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:UpperBound')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:UpperBound" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
> <A HREF="Distribution-Version.html#t%3AUpperBound"
>UpperBound</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Ord.html#t%3AOrd"
>Ord</A
> <A HREF="Distribution-Version.html#t%3AUpperBound"
>UpperBound</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> <A HREF="Distribution-Version.html#t%3AUpperBound"
>UpperBound</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:Bound"
><A NAME="t%3ABound"
></A
></A
><B
>Bound</B
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
>Constructors</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:ExclusiveBound"
><A NAME="v%3AExclusiveBound"
></A
></A
><B
>ExclusiveBound</B
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:InclusiveBound"
><A NAME="v%3AInclusiveBound"
></A
></A
><B
>InclusiveBound</B
></TD
><TD CLASS="rdoc"
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Bound')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:Bound" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
> <A HREF="Distribution-Version.html#t%3ABound"
>Bound</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> <A HREF="Distribution-Version.html#t%3ABound"
>Bound</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="6"
><A NAME="6"
><TT
><A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TT
> abstract type
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="doc"
>The <TT
><A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TT
> type and the accompanying functions are exposed
 primarily for completeness and testing purposes. In practice 
 <TT
><A HREF="Distribution-Version.html#v%3AasVersionIntervals"
>asVersionIntervals</A
></TT
> is the main function to use to
 view a <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
> as a bunch of <TT
><A HREF="Distribution-Version.html#t%3AVersionInterval"
>VersionInterval</A
></TT
>s.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:VersionIntervals"
><A NAME="t%3AVersionIntervals"
></A
></A
><B
>VersionIntervals</B
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
><P
>A complementary representation of a <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
>. Instead of a boolean
 version predicate it uses an increasing sequence of non-overlapping,
 non-empty intervals.
</P
><P
>The key point is that this representation gives a canonical representation
 for the semantics of <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
>s. This makes it easier to check things
 like whether a version range is empty, covers all versions, or requires a
 certain minimum or maximum version. It also makes it easy to check equality
 or containment. It also makes it easier to identify 'simple' version
 predicates for translation into foreign packaging systems that do not
 support complex version range expressions.
</P
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:VersionIntervals')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:VersionIntervals" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
> <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:toVersionIntervals"
><A NAME="v%3AtoVersionIntervals"
></A
></A
><B
>toVersionIntervals</B
> :: <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
><TR
><TD CLASS="doc"
>Convert a <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
> to a sequence of version intervals.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:fromVersionIntervals"
><A NAME="v%3AfromVersionIntervals"
></A
></A
><B
>fromVersionIntervals</B
> :: <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TD
></TR
><TR
><TD CLASS="doc"
>Convert a <TT
><A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TT
> value back into a <TT
><A HREF="Distribution-Version.html#t%3AVersionRange"
>VersionRange</A
></TT
> expression
 representing the version intervals.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:withinIntervals"
><A NAME="v%3AwithinIntervals"
></A
></A
><B
>withinIntervals</B
> :: <A HREF="Distribution-Version.html#t%3AVersion"
>Version</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="../base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Test if a version falls within the version intervals.
</P
><P
>It exists mostly for completeness and testing. It satisfies the following
 properties:
</P
><PRE
> withinIntervals v (toVersionIntervals vr) = withinRange v vr
 withinIntervals v ivs = withinRange v (fromVersionIntervals ivs)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:versionIntervals"
><A NAME="v%3AversionIntervals"
></A
></A
><B
>versionIntervals</B
> :: <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; [<A HREF="Distribution-Version.html#t%3AVersionInterval"
>VersionInterval</A
>]</TD
></TR
><TR
><TD CLASS="doc"
>Inspect the list of version intervals.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkVersionIntervals"
><A NAME="v%3AmkVersionIntervals"
></A
></A
><B
>mkVersionIntervals</B
> :: [<A HREF="Distribution-Version.html#t%3AVersionInterval"
>VersionInterval</A
>] -&gt; <A HREF="../base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Directly construct a <TT
><A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TT
> from a list of intervals.
</P
><P
>Each interval must be non-empty. The sequence must be in increasing order
 and no invervals may overlap or touch. If any of these conditions are not
 satisfied the function returns <TT
>Nothing</TT
>.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:unionVersionIntervals"
><A NAME="v%3AunionVersionIntervals"
></A
></A
><B
>unionVersionIntervals</B
> :: <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:intersectVersionIntervals"
><A NAME="v%3AintersectVersionIntervals"
></A
></A
><B
>intersectVersionIntervals</B
> :: <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
> -&gt; <A HREF="Distribution-Version.html#t%3AVersionIntervals"
>VersionIntervals</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="botbar"
>Produced by <A HREF="http://www.haskell.org/haddock/"
>Haddock</A
> version 2.6.1</TD
></TR
></TABLE
></BODY
></HTML
>