module Agda.Version
  ( version
  , package
  ) where

import GHC.Generics ( Generic, Rep, packageName )
import Data.List ( intercalate )
import Data.Version ( Version(versionBranch) )

import qualified Paths_Agda as PA

-- | The version of Agda.

version :: String
version :: String
version = String -> [String] -> String
forall a. [a] -> [[a]] -> [a]
intercalate String
"." ([String] -> String) -> [String] -> String
forall a b. (a -> b) -> a -> b
$ (Int -> String) -> [Int] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map Int -> String
forall a. Show a => a -> String
show ([Int] -> [String]) -> [Int] -> [String]
forall a b. (a -> b) -> a -> b
$
            Version -> [Int]
versionBranch Version
PA.version

-- | This package name.
-- This is mainly intended for use in the test suites to filter ephemeral
-- hash-fingerprinted package names like @Agda-2.6.2-5ceeWeguf1QFMaHLput4zw@.

package :: String
package :: String
package = M1
  D
  ('MetaData
     "AnArbitrarySymbolInThisPackage"
     "Agda.Version"
     "Agda-2.6.2.2-DXbLWdCWC6QEApzM0094If"
     'False)
  V1
  Any
-> String
forall k (d :: k) k1 (t :: k -> (k1 -> *) -> k1 -> *)
       (f :: k1 -> *) (a :: k1).
Datatype d =>
t d f a -> String
packageName (forall p. Rep AnArbitrarySymbolInThisPackage p
forall a. HasCallStack => a
undefined :: Rep AnArbitrarySymbolInThisPackage p)

data AnArbitrarySymbolInThisPackage deriving (forall x.
 AnArbitrarySymbolInThisPackage
 -> Rep AnArbitrarySymbolInThisPackage x)
-> (forall x.
    Rep AnArbitrarySymbolInThisPackage x
    -> AnArbitrarySymbolInThisPackage)
-> Generic AnArbitrarySymbolInThisPackage
forall x.
Rep AnArbitrarySymbolInThisPackage x
-> AnArbitrarySymbolInThisPackage
forall x.
AnArbitrarySymbolInThisPackage
-> Rep AnArbitrarySymbolInThisPackage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AnArbitrarySymbolInThisPackage x
-> AnArbitrarySymbolInThisPackage
$cfrom :: forall x.
AnArbitrarySymbolInThisPackage
-> Rep AnArbitrarySymbolInThisPackage x
Generic