refactor: use upstream TH constructors

This commit is contained in:
Colin Woodbury
2023-10-13 17:35:39 +09:00
committed by Julian Ospald
parent eae197ccb3
commit 1981a12e67
8 changed files with 91 additions and 101 deletions

View File

@@ -4,14 +4,9 @@ module Utils where
import GHCup.OptParse as GHCup
import Options.Applicative
import Data.Bifunctor
import Data.Versions
import Data.List.NonEmpty (NonEmpty)
import Test.Tasty
import Test.Tasty.HUnit
import Control.Monad.IO.Class
import qualified Data.Text as T
import Language.Haskell.TH (Exp, Q)
import Language.Haskell.TH.Syntax (lift)
parseWith :: [String] -> IO Command
parseWith args =
@@ -25,13 +20,6 @@ padLeft desiredLength s = padding ++ s
mapSecond :: (b -> c) -> [(a,b)] -> [(a,c)]
mapSecond = map . second
-- | Parse a `Version` at compile time.
verQ :: T.Text -> Q Exp
verQ nm =
case version nm of
Left err -> fail (errorBundlePretty err)
Right v -> lift v
buildTestTree
:: (Eq a, Show a)
=> ([String] -> IO a) -- ^ The parse function