From 23d82c621f59ed80695529a8c3724f87b4127873 Mon Sep 17 00:00:00 2001 From: Zachary Snow Date: Sun, 18 Jul 2021 20:12:06 -0400 Subject: [PATCH] paramtype conversion no longer sorts by type --- src/Convert/ParamType.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Convert/ParamType.hs b/src/Convert/ParamType.hs index 6cfc497..86ac7a1 100644 --- a/src/Convert/ParamType.hs +++ b/src/Convert/ParamType.hs @@ -20,7 +20,7 @@ type TypeMap = Map.Map Identifier Type type Modules = Map.Map Identifier TypeMap type Instance = Map.Map Identifier (Type, IdentSet) -type Instances = Set.Set (Identifier, Instance) +type Instances = Map.Map String (Identifier, Instance) type IdentSet = Set.Set Identifier type DeclMap = Map.Map Identifier Decl @@ -34,7 +34,7 @@ convert files = mapM (collectDescriptionsM collectDescriptionM) files (files', instancesRaw) = runWriter $ mapM (mapM convertDescriptionM) files - instances = Set.toList instancesRaw + instances = Map.elems instancesRaw -- add type parameter instantiations files'' = map (concatMap explodeDescription) files' @@ -283,8 +283,8 @@ convertModuleItemM (orig @ (Instance m bindings x r p)) = if hasOnlyExprs then return orig else if not hasUnresolvedTypes then do - tell $ Set.singleton (m, resolvedTypes) let m' = moduleInstanceName m resolvedTypes + tell $ Map.singleton m' (m, resolvedTypes) return $ Generate $ map GenModuleItem $ map (MIPackageItem . Decl) addedDecls ++ [Instance m' (additionalBindings ++ exprBindings) x r p] @@ -292,7 +292,7 @@ convertModuleItemM (orig @ (Instance m bindings x r p)) = return orig else do let m' = TemplateTag m - tell $ Set.singleton (m, Map.empty) + tell $ Map.singleton m' (m, Map.empty) return $ Instance m' bindings x r p where hasOnlyExprs = all (isRight . snd) bindings