Remove (by commenting out) module item-type system
This commit is contained in:
+29
-26
@@ -61,34 +61,37 @@ combineListInfo w = filter f . map (cmm inv) $ combineItemListYouX w
|
||||
f (is, (_, itm)) = _itType itm `notElem` fmap _itType (IM.restrictKeys inv (IS.fromList is))
|
||||
|
||||
cmm :: IM.IntMap Item -> ([Int], Item) -> ([Int], ([String], Item))
|
||||
cmm inv (is, itm) = (is, itm & itType . iyModules %%~ flip combineModuleMaps mms)
|
||||
where
|
||||
mms = map (_iyModules . _itType . (inv IM.!)) is
|
||||
cmm inv (is, itm) = (is, ([], itm))
|
||||
|
||||
combineModuleMaps ::
|
||||
M.Map ModuleSlot ItemModuleType ->
|
||||
[M.Map ModuleSlot ItemModuleType] ->
|
||||
([String], M.Map ModuleSlot ItemModuleType)
|
||||
combineModuleMaps = foldM combineTwoModuleMaps
|
||||
--cmm :: IM.IntMap Item -> ([Int], Item) -> ([Int], ([String], Item))
|
||||
--cmm inv (is, itm) = (is, itm & itType . iyModules %%~ flip combineModuleMaps mms)
|
||||
-- where
|
||||
-- mms = map (_iyModules . _itType . (inv IM.!)) is
|
||||
|
||||
combineTwoModuleMaps ::
|
||||
M.Map ModuleSlot ItemModuleType ->
|
||||
M.Map ModuleSlot ItemModuleType ->
|
||||
([String], M.Map ModuleSlot ItemModuleType)
|
||||
combineTwoModuleMaps =
|
||||
mergeA
|
||||
preserveMissing
|
||||
(filterAMissing f)
|
||||
(zipWithAMatched g)
|
||||
where
|
||||
f _ EMPTYMODULE = ([], False)
|
||||
f _ md = ([rm "REMOVES" md], False)
|
||||
g _ EMPTYMODULE md = ([], md)
|
||||
g _ md EMPTYMODULE = ([], md)
|
||||
g _ md2 md1 = ([rm "REPLACES" md1 ++ rm " WITH" md2], md2)
|
||||
rm str md = str ++ " " ++ fullModuleName md
|
||||
--combineModuleMaps ::
|
||||
-- M.Map ModuleSlot ItemModuleType ->
|
||||
-- [M.Map ModuleSlot ItemModuleType] ->
|
||||
-- ([String], M.Map ModuleSlot ItemModuleType)
|
||||
--combineModuleMaps = foldM combineTwoModuleMaps
|
||||
|
||||
--combineTwoModuleMaps ::
|
||||
-- M.Map ModuleSlot ItemModuleType ->
|
||||
-- M.Map ModuleSlot ItemModuleType ->
|
||||
-- ([String], M.Map ModuleSlot ItemModuleType)
|
||||
--combineTwoModuleMaps =
|
||||
-- mergeA
|
||||
-- preserveMissing
|
||||
-- (filterAMissing f)
|
||||
-- (zipWithAMatched g)
|
||||
-- where
|
||||
-- f _ EMPTYMODULE = ([], False)
|
||||
-- f _ md = ([rm "REMOVES" md], False)
|
||||
-- g _ EMPTYMODULE md = ([], md)
|
||||
-- g _ md EMPTYMODULE = ([], md)
|
||||
-- g _ md2 md1 = ([rm "REPLACES" md1 ++ rm " WITH" md2], md2)
|
||||
-- rm str md = str ++ " " ++ fullModuleName md
|
||||
|
||||
-- g above could be a monoid of some description...
|
||||
|
||||
fullModuleName :: ItemModuleType -> String
|
||||
fullModuleName = fromMaybe "EMPTYMODULE" . moduleName
|
||||
--fullModuleName :: ItemModuleType -> String
|
||||
--fullModuleName = fromMaybe "EMPTYMODULE" . moduleName
|
||||
|
||||
Reference in New Issue
Block a user