Types.hs 649 B

1234567891011121314151617181920212223242526272829
  1. {-# LANGUAGE TemplateHaskell #-}
  2. {-# OPTIONS_GHC -Wno-missing-signatures #-}
  3. module Types
  4. ( Compiler(..)
  5. , compilerVersion
  6. , Config(..)
  7. , configInstallPath
  8. , configCurrentCompiler
  9. , compilerString
  10. ) where
  11. import qualified Lens.Family.TH as Lens
  12. data Compiler = Compiler
  13. { _compilerVersion :: (Int, Int, Int)
  14. } deriving (Eq, Show)
  15. data Config = Config
  16. { _configInstallPath :: FilePath
  17. , _configCurrentCompiler :: Maybe Compiler
  18. } deriving (Eq, Show)
  19. Lens.makeLenses ''Compiler
  20. Lens.makeLenses ''Config
  21. compilerString :: Compiler -> String
  22. compilerString (Compiler (x, y, z)) =
  23. "ghc-" ++ show x ++ "." ++ show y ++ "." ++ show z