gdritter repos hatch / master src / Types.hs
master

Tree @master (Download .tar.gz)

Types.hs @masterraw · history · blame

{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wno-missing-signatures #-}

module Types
( Compiler(..)
, compilerVersion
, Config(..)
, configInstallPath
, configCurrentCompiler
, compilerString
) where

import qualified Lens.Family.TH as Lens

data Compiler = Compiler
  { _compilerVersion :: (Int, Int, Int)
  } deriving (Eq, Show)

data Config = Config
  { _configInstallPath     :: FilePath
  , _configCurrentCompiler :: Maybe Compiler
  } deriving (Eq, Show)

Lens.makeLenses ''Compiler
Lens.makeLenses ''Config

compilerString :: Compiler -> String
compilerString (Compiler (x, y, z)) =
  "ghc-" ++ show x ++ "." ++ show y ++ "." ++ show z