From: Matthijs Kooijman Date: Sun, 21 Jun 2009 14:49:36 +0000 (+0200) Subject: Add getGlobalBinders accessor. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=17fa4b76161e0b6916f50aaacc2aeb2b6fc21993;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add getGlobalBinders accessor. --- diff --git a/NormalizeTypes.hs b/NormalizeTypes.hs index e959bbb..5c7c24a 100644 --- a/NormalizeTypes.hs +++ b/NormalizeTypes.hs @@ -47,3 +47,9 @@ getGlobalBind bndr = do -- Adds a new global binding with the given value addGlobalBind :: CoreBndr -> CoreExpr -> TransformSession () addGlobalBind bndr expr = modA tsBindings (Map.insert bndr expr) + +-- Returns a list of all global binders +getGlobalBinders :: TransformSession [CoreBndr] +getGlobalBinders = do + bindings <- getA tsBindings + return $ Map.keys bindings