Commit f56db204 authored by lennart@augustsson.net's avatar lennart@augustsson.net
Browse files

Export nameEnvUniqueElts, similar to nameEnvElts, but giving the Unique as well.

parent 102b73a3
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
\begin{code} \begin{code}
module NameEnv ( module NameEnv (
NameEnv, mkNameEnv, NameEnv, mkNameEnv,
emptyNameEnv, unitNameEnv, nameEnvElts, emptyNameEnv, unitNameEnv, nameEnvElts, nameEnvUniqueElts,
extendNameEnv_C, extendNameEnv_Acc, extendNameEnv, extendNameEnv_C, extendNameEnv_Acc, extendNameEnv,
extendNameEnvList, extendNameEnvList_C, extendNameEnvList, extendNameEnvList_C,
foldNameEnv, filterNameEnv, foldNameEnv, filterNameEnv,
...@@ -19,6 +19,7 @@ module NameEnv ( ...@@ -19,6 +19,7 @@ module NameEnv (
#include "HsVersions.h" #include "HsVersions.h"
import Name import Name
import Unique(Unique)
import UniqFM import UniqFM
import Maybes import Maybes
\end{code} \end{code}
...@@ -35,6 +36,7 @@ type NameEnv a = UniqFM a -- Domain is Name ...@@ -35,6 +36,7 @@ type NameEnv a = UniqFM a -- Domain is Name
emptyNameEnv :: NameEnv a emptyNameEnv :: NameEnv a
mkNameEnv :: [(Name,a)] -> NameEnv a mkNameEnv :: [(Name,a)] -> NameEnv a
nameEnvElts :: NameEnv a -> [a] nameEnvElts :: NameEnv a -> [a]
nameEnvUniqueElts :: NameEnv a -> [(Unique, a)]
extendNameEnv_C :: (a->a->a) -> NameEnv a -> Name -> a -> NameEnv a extendNameEnv_C :: (a->a->a) -> NameEnv a -> Name -> a -> NameEnv a
extendNameEnv_Acc :: (a->b->b) -> (a->b) -> NameEnv b -> Name -> a -> NameEnv b extendNameEnv_Acc :: (a->b->b) -> (a->b) -> NameEnv b -> Name -> a -> NameEnv b
extendNameEnv :: NameEnv a -> Name -> a -> NameEnv a extendNameEnv :: NameEnv a -> Name -> a -> NameEnv a
...@@ -56,6 +58,7 @@ emptyNameEnv = emptyUFM ...@@ -56,6 +58,7 @@ emptyNameEnv = emptyUFM
foldNameEnv = foldUFM foldNameEnv = foldUFM
mkNameEnv = listToUFM mkNameEnv = listToUFM
nameEnvElts = eltsUFM nameEnvElts = eltsUFM
nameEnvUniqueElts = ufmToList
extendNameEnv_C = addToUFM_C extendNameEnv_C = addToUFM_C
extendNameEnv_Acc = addToUFM_Acc extendNameEnv_Acc = addToUFM_Acc
extendNameEnv = addToUFM extendNameEnv = addToUFM
......
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