Copyright | (c) 2018-2021 Sam May |
---|---|
License | GPL-3.0-or-later |
Maintainer | ag@eitilt.life |
Stability | stable |
Portability | non-portable (requires libcdio) |
Safe Haskell | None |
Language | Haskell2010 |
The values in this module are best treated as informational; it may be helpful
to use cdioVersionString
in printing copyright, for example, and
libcdioVersionNum
does serve a purpose in the tests, but all are of little
value outside of such very particular situations. Instead, an effort has been
made to have all version differences in the base library degrade gracefully,
and those fallback values are able to be handled transparently. For example,
rather than explicitly testing whether libcdio is new enough to have exposed
cdtext_data_init
, simply call cdTextDataInit
and
have a plan for if it returns Nothing
rather than a
.Just
CdText
version.h
Defines
CDIO_VERSION
(removed; identical tocdioVersionString
)LIBCDIO_VERSION_NUM
(removed; identical tolibcdioVersionNum
)
Symbols
cdio_version_string
->cdioVersionString
libcdio_version_num
->libcdioVersionNum
Sound.Libcdio
Re-exported unchanged as there is little reason for it to be a separate module, and no changes need to be made to the types.
Synopsis
- data Version
- makeVersion :: [Int] -> Version
- cdioVersionString :: String
- libcdioVersionNum :: Version
- apiVersion :: Word
Documentation
A Version
represents the version of a software entity.
An instance of Eq
is provided, which implements exact equality
modulo reordering of the tags in the versionTags
field.
An instance of Ord
is also provided, which gives lexicographic
ordering on the versionBranch
fields (i.e. 2.1 > 2.0, 1.2.3 > 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 "pre1"
, "pre2"
, 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 date
tags in the versionTags
field and compare those.
The bottom line is, don't always assume that compare
and other Ord
operations are the right thing for every Version
.
Similarly, concrete representations of versions may differ. One
possible concrete representation is provided (see showVersion
and
parseVersion
), but depending on the application a different concrete
representation may be more appropriate.
Instances
IsList Version | Since: base-4.8.0.0 |
Eq Version | Since: base-2.1 |
Ord Version | Since: base-2.1 |
Read Version | Since: base-2.1 |
Show Version | Since: base-2.1 |
Generic Version | Since: base-4.9.0.0 |
type Rep Version | |
Defined in Data.Version type Rep Version = D1 ('MetaData "Version" "Data.Version" "base" 'False) (C1 ('MetaCons "Version" 'PrefixI 'True) (S1 ('MetaSel ('Just "versionBranch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int]) :*: S1 ('MetaSel ('Just "versionTags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String]))) | |
type Item Version | |
makeVersion :: [Int] -> Version #
Construct tag-less Version
Since: base-4.8.0.0
cdioVersionString :: String Source #
The value of the preprocessor macro CDIO_VERSION
, listing both the
SemVar-style version of libcdio and the full architecture of the system
which compiled it (e.g. 2.0.0 x86_64-pc-linux-gnu
).
libcdioVersionNum :: Version Source #
The value of the preprocessor macro LIBCDIO_VERSION_NUM
, containing a
numeric representation of the version suitable for arithmetic testing.
apiVersion :: Word Source #
The value of the preprocessor macro CDIO_API_VERSION
, containing a
single, monotonically increasing constant representing changes to the public
interface. However, as it's somewhat unclear what changes warrant bumping
this number, it is typically better to use libcdioVersionNum
instead.