From ff4023bca43797a5065292ee0711380df7cce6ad Mon Sep 17 00:00:00 2001 From: "Niels G. W. Serup" Date: Sun, 6 Oct 2024 15:23:09 +0200 Subject: [PATCH] Remove unused appends --- byg/src/DependencyGenerator.hs | 8 -------- byg/src/Evaluation/Function.hs | 6 ------ byg/src/Types/Function.hs | 4 +--- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/byg/src/DependencyGenerator.hs b/byg/src/DependencyGenerator.hs index fcf0829..cfb0fc6 100644 --- a/byg/src/DependencyGenerator.hs +++ b/byg/src/DependencyGenerator.hs @@ -24,9 +24,7 @@ module DependencyGenerator , unzipSndDepGenM , unzipDepGenM - , appendStrings , concatStrings - , appendTexts , concatTexts , joinPaths , fileComponents @@ -197,15 +195,9 @@ unzipDepGenM t = do b <- unzipSndDepGenM t' pure (a, b) -appendStrings :: (TokenableTo String a, TokenableTo String b) => a -> b -> DepGenM (Token String) -appendStrings a b = runFunction AppendStrings =<< TupleToken <$> toToken a <*> toToken b - concatStrings :: TokenableTo [String] a => a -> DepGenM (Token String) concatStrings a = runFunction ConcatStrings =<< toToken a -appendTexts :: (TokenableTo Text a, TokenableTo Text b) => a -> b -> DepGenM (Token Text) -appendTexts a b = runFunction AppendTexts =<< toTupleToken a b - concatTexts :: TokenableTo [Text] a => a -> DepGenM (Token Text) concatTexts a = runFunction ConcatTexts =<< toToken a diff --git a/byg/src/Evaluation/Function.hs b/byg/src/Evaluation/Function.hs index f8625b9..4bdce7d 100644 --- a/byg/src/Evaluation/Function.hs +++ b/byg/src/Evaluation/Function.hs @@ -30,15 +30,9 @@ unStringWrapper = \case evalFunction :: Function -> Value -> Value evalFunction f x = case (f, x) of - (AppendStrings, Tuple (String (StringWrapper s0), String (StringWrapper s1))) -> - makeString (s0 ++ s1) - (ConcatStrings, List vs) -> makeString $ concatMap unStringWrapper vs - (AppendTexts, Tuple (Text t0, Text t1)) -> - Text $ T.append t0 t1 - (ConcatTexts, List vs) -> Text $ T.concat $ map fromValue vs diff --git a/byg/src/Types/Function.hs b/byg/src/Types/Function.hs index 7b0bc87..803cd83 100644 --- a/byg/src/Types/Function.hs +++ b/byg/src/Types/Function.hs @@ -4,9 +4,7 @@ module Types.Function import Language.Haskell.TH.Syntax (Lift) -data Function = AppendStrings - | ConcatStrings - | AppendTexts +data Function = ConcatStrings | ConcatTexts | JoinPaths | FileComponents