Remove unused appends
This commit is contained in:
parent
f8e80ae2bc
commit
ff4023bca4
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@ module Types.Function
|
|||
|
||||
import Language.Haskell.TH.Syntax (Lift)
|
||||
|
||||
data Function = AppendStrings
|
||||
| ConcatStrings
|
||||
| AppendTexts
|
||||
data Function = ConcatStrings
|
||||
| ConcatTexts
|
||||
| JoinPaths
|
||||
| FileComponents
|
||||
|
|
Loading…
Reference in New Issue