module Debian.Version.Internal
( DebianVersion(..)
, Numeric(..)
, NonNumeric(..)
, Found(..)
) where
import Data.Data (Data)
import Data.Typeable (Typeable)
data DebianVersion
= DebianVersion String (Found Int, NonNumeric, Found NonNumeric) deriving (Data, Typeable)
data NonNumeric
= NonNumeric String (Found Numeric)
deriving (Show, Data, Typeable)
data Numeric
= Numeric Int (Maybe NonNumeric)
deriving (Show, Data, Typeable)
data Found a
= Found { unFound :: a }
| Simulated { unFound :: a }
deriving (Show, Data, Typeable)
instance (Eq a) => Eq (Found a) where
f1 == f2 = (unFound f1) == (unFound f2)
instance (Ord a) => Ord (Found a) where
compare f1 f2 = compare (unFound f1) (unFound f2)