-- -------------------------------------------------------------------------- -- $Revision: 1006 $ $Date: 2011-04-21 09:39:00 +0200 (Thu, 21 Apr 2011) $ -- -------------------------------------------------------------------------- -- | -- -- Module : Encode.Version -- Copyright : Otakar Smrz 2005-2011 -- License : GPL -- -- Maintainer : otakar.smrz mff.cuni.cz -- Stability : provisional -- Portability : portable -- -- Exports the 'version' of the "Encode" library and provides support -- for working with the SVN\/CVS revision keyword. The 'revised' method -- parses the '$Revision ... $' string supplied to it. Results have the -- type 'Version' of the "Data.Version" module, which is exported, too. module Encode.Version ( -- * Module module Data.Version, -- * Functions revised, version ) where import Data.Version import Text.ParserCombinators.ReadP revised :: String -> Version revised revision = fst . last . readP_to_S parseVersion $ words revision !! 1 version = Version [1, 3, min build 5] [] where Version [build] [] = revised "$Revision: 1006 $"