Skip to content
Snippets Groups Projects
Commit 83a631e0 authored by David Waern's avatar David Waern
Browse files

Remove OrdName stuff

parent c1edcc6e
No related branches found
No related tags found
No related merge requests found
......@@ -116,36 +116,13 @@ lookupRn and_then name = do
(True, maps_to) -> return (and_then maps_to)
--------------------------------------------------------------------------------
-- Looking up names
--------------------------------------------------------------------------------
newtype OrdName = MkOrdName Name
instance Eq OrdName where
(MkOrdName a) == (MkOrdName b) = compare a b == EQ
instance Ord OrdName where
(MkOrdName a) `compare` (MkOrdName b) =
case (nameModule_maybe a, nameModule_maybe b) of
(Just modA, Just modB) ->
(modA `compare` modB) `thenCmp` (getOccName a `compare` getOccName b)
(Nothing, Nothing) -> getOccName a `compare` getOccName b
_ -> LT
instance Outputable OrdName where
ppr (MkOrdName x) = ppr (nameOccName x)
runRnFM :: LinkEnv -> RnM a -> (a,[Name])
runRnFM env rn = unRn rn lkp
where
lkp n = case Map.lookup (MkOrdName n) ordEnv of
lkp n = case Map.lookup n env of
Nothing -> (False, NoLink n)
Just q -> (True, Link q)
ordEnv = Map.fromList . map (MkOrdName *** id) . Map.toList $ env
--------------------------------------------------------------------------------
-- Renaming
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment