Remove unused appends

This commit is contained in:
Niels G. W. Serup 2024-10-06 15:23:09 +02:00
parent f8e80ae2bc
commit ff4023bca4
No known key found for this signature in database
GPG Key ID: 38EEEBCE67324F19
3 changed files with 1 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -4,9 +4,7 @@ module Types.Function
import Language.Haskell.TH.Syntax (Lift)
data Function = AppendStrings
| ConcatStrings
| AppendTexts
data Function = ConcatStrings
| ConcatTexts
| JoinPaths
| FileComponents