From 88479e4c70236766c3e5fdca66dc3dc4436c3023 Mon Sep 17 00:00:00 2001 From: MartinSStewart Date: Sun, 18 Feb 2024 18:35:55 +0100 Subject: [PATCH] Reduce noise from diff --- extra/Lamdera/Evergreen/MigrationGenerator.hs | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/extra/Lamdera/Evergreen/MigrationGenerator.hs b/extra/Lamdera/Evergreen/MigrationGenerator.hs index 79d620c6..b17d2af9 100644 --- a/extra/Lamdera/Evergreen/MigrationGenerator.hs +++ b/extra/Lamdera/Evergreen/MigrationGenerator.hs @@ -665,11 +665,11 @@ canAliasToMigration oldVersion newVersion scope interfaces recursionSet (typeNew usageParamMigrationFns :: [Text] usageParamMigrationFns = usageParamMigrations & fmap migrationFn - tvarsNew :: [N.Name] - tvarsNew = tvarMapNew & fmap fst + tvarsNew :: [Text] + tvarsNew = tvarMapNew & fmap (N.toText . fst) - tvarsOld :: [N.Name] - tvarsOld = tvarMapOldReplaced & fmap fst + tvarsOld :: [Text] + tvarsOld = tvarMapOldReplaced & fmap (N.toText . fst) (MigrationNested migrationAliasedType imps subDefs) = let @@ -685,19 +685,17 @@ canAliasToMigration oldVersion newVersion scope interfaces recursionSet (typeNew migrationName :: Text migrationName = migrationNameUnderscored newModule oldVersion newVersion typeNameNew - paramMigrationPairs :: [(N.Name, N.Name)] - paramMigrationPairs = - zip tvarsOld tvarsNew + paramMigrationPairs = zip tvarsOld tvarsNew paramMigrationFnsTypeSig :: [Text] paramMigrationFnsTypeSig = paramMigrationPairs - & fmap (\(oldT, newT) -> T.concat [ "(", N.toText oldT, "_old -> ", N.toText newT, "_new)" ] ) + & fmap (\(oldT, newT) -> T.concat [ "(", oldT, "_old -> ", newT, "_new)" ] ) paramMigrationVars :: Text paramMigrationVars = paramMigrationPairs - & fmap (\(oldT, newT) -> T.concat [ "migrate_", N.toText oldT ] ) + & fmap (\(oldT, newT) -> T.concat [ "migrate_", oldT ] ) & T.intercalate " " oldType = T.concat [moduleNameOld & dropCan & N.toText, ".", typeNameOld & N.toText] @@ -707,9 +705,9 @@ canAliasToMigration oldVersion newVersion scope interfaces recursionSet (typeNew migrationTypeSignature = T.concat [ paramMigrationFnsTypeSig & T.intercalate " -> " & suffixIfNonempty " -> " , " " , oldType , " " - , tvarsOld & fmap (\tvar -> T.concat [N.toText tvar, "_old"]) & T.intercalate " " + , tvarsOld & fmap (\tvar -> T.concat [tvar, "_old"]) & T.intercalate " " , " -> " , newType , " " - , tvarsNew & fmap (\tvar -> T.concat [N.toText tvar, "_new"]) & T.intercalate " " + , tvarsNew & fmap (\tvar -> T.concat [tvar, "_new"]) & T.intercalate " " ] applyOldValueIfNotRecord m =