Types.hs 528 B

12345678910111213141516171819202122
  1. {-# LANGUAGE TemplateHaskell #-}
  2. module Types where
  3. import qualified Data.Text as T
  4. import qualified Lens.Family.TH as Lens
  5. data Compiler = Compiler
  6. { _compilerVersion :: (Int, Int, Int)
  7. } deriving (Eq, Show)
  8. data Config = Config
  9. { _configInstallPath :: FilePath
  10. , _configCurrentCompiler :: Maybe Compiler
  11. } deriving (Eq, Show)
  12. Lens.makeLenses ''Compiler
  13. Lens.makeLenses ''Config
  14. compilerString :: Compiler -> String
  15. compilerString (Compiler (x, y, z)) =
  16. "ghc-" ++ show x ++ "." ++ show y ++ "." ++ show z