cpkg-0.2.3.6: src/Package/C/Type/Version.hs
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
module Package.C.Type.Version ( Version (..)
, showVersion
) where
import CPkgPrelude
import Data.List (intercalate)
newtype Version = Version [ Natural ]
deriving (Eq, Ord, FromDhall, Binary, Hashable)
showVersion :: Version -> String
showVersion (Version v) = intercalate "." (show <$> v)
instance Pretty Version where
pretty (Version v) = fold (punctuate "." (pretty <$> v))