Commit 23d82c62 by Zachary Snow

paramtype conversion no longer sorts by type

parent 16a13ee9
...@@ -20,7 +20,7 @@ type TypeMap = Map.Map Identifier Type ...@@ -20,7 +20,7 @@ type TypeMap = Map.Map Identifier Type
type Modules = Map.Map Identifier TypeMap type Modules = Map.Map Identifier TypeMap
type Instance = Map.Map Identifier (Type, IdentSet) 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 IdentSet = Set.Set Identifier
type DeclMap = Map.Map Identifier Decl type DeclMap = Map.Map Identifier Decl
...@@ -34,7 +34,7 @@ convert files = ...@@ -34,7 +34,7 @@ convert files =
mapM (collectDescriptionsM collectDescriptionM) files mapM (collectDescriptionsM collectDescriptionM) files
(files', instancesRaw) = (files', instancesRaw) =
runWriter $ mapM (mapM convertDescriptionM) files runWriter $ mapM (mapM convertDescriptionM) files
instances = Set.toList instancesRaw instances = Map.elems instancesRaw
-- add type parameter instantiations -- add type parameter instantiations
files'' = map (concatMap explodeDescription) files' files'' = map (concatMap explodeDescription) files'
...@@ -283,8 +283,8 @@ convertModuleItemM (orig @ (Instance m bindings x r p)) = ...@@ -283,8 +283,8 @@ convertModuleItemM (orig @ (Instance m bindings x r p)) =
if hasOnlyExprs then if hasOnlyExprs then
return orig return orig
else if not hasUnresolvedTypes then do else if not hasUnresolvedTypes then do
tell $ Set.singleton (m, resolvedTypes)
let m' = moduleInstanceName m resolvedTypes let m' = moduleInstanceName m resolvedTypes
tell $ Map.singleton m' (m, resolvedTypes)
return $ Generate $ map GenModuleItem $ return $ Generate $ map GenModuleItem $
map (MIPackageItem . Decl) addedDecls ++ map (MIPackageItem . Decl) addedDecls ++
[Instance m' (additionalBindings ++ exprBindings) x r p] [Instance m' (additionalBindings ++ exprBindings) x r p]
...@@ -292,7 +292,7 @@ convertModuleItemM (orig @ (Instance m bindings x r p)) = ...@@ -292,7 +292,7 @@ convertModuleItemM (orig @ (Instance m bindings x r p)) =
return orig return orig
else do else do
let m' = TemplateTag m let m' = TemplateTag m
tell $ Set.singleton (m, Map.empty) tell $ Map.singleton m' (m, Map.empty)
return $ Instance m' bindings x r p return $ Instance m' bindings x r p
where where
hasOnlyExprs = all (isRight . snd) bindings hasOnlyExprs = all (isRight . snd) bindings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment