{- |
    Module      :  $Header$
    Description :  File pathes
    Copyright   :  (c) 2011, Björn Peemöller (bjp@informatik.uni-kiel.de)
    License     :  BSD-3-clause

    Maintainer  :  bjp@informatik.uni-kiel.de
    Stability   :  experimental
    Portability :  portable

    This module contains functions to obtain the version number and path
    of the front end binary.
-}
module Files.CymakePath (getCymake, cymakeGreeting, cymakeVersion) where

import Data.Version (showVersion)
import System.FilePath ((</>))
import Paths_curry_frontend

-- | Show a greeting of the current front end
cymakeGreeting :: String
cymakeGreeting :: String
cymakeGreeting = "This is the Curry front end, version " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
cymakeVersion

-- | Retrieve the version number of cymake
cymakeVersion :: String
cymakeVersion :: String
cymakeVersion = Version -> String
showVersion Version
version

-- | Retrieve the location of the front end executable
getCymake :: IO String
getCymake :: IO String
getCymake = do
  String
cymakeDir <- IO String
getBinDir
  String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return (String -> IO String) -> String -> IO String
forall a b. (a -> b) -> a -> b
$ String
cymakeDir String -> String -> String
</> "curry-frontend"