From da493897ac6ee2b17a0c58b51315f9d136de730d Mon Sep 17 00:00:00 2001 From: Adam Gundry Date: Tue, 14 Feb 2017 09:53:28 -0500 Subject: Implement HasField constraint solving and modify OverloadedLabels This implements automatic constraint solving for the new HasField class and modifies the existing OverloadedLabels extension, as described in the GHC proposal (https://github.com/ghc-proposals/ghc-proposals/pull/6). Per the current form of the proposal, it does *not* currently introduce a separate `OverloadedRecordFields` extension. This replaces D1687. The users guide documentation still needs to be written, but I'll do that after the implementation is merged, in case there are further design changes. Test Plan: new and modified tests in overloadedrecflds Reviewers: simonpj, goldfire, dfeuer, bgamari, austin, hvr Reviewed By: bgamari Subscribers: maninalift, dfeuer, ysangkok, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D2708 --- compiler/utils/FastStringEnv.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/utils') diff --git a/compiler/utils/FastStringEnv.hs b/compiler/utils/FastStringEnv.hs index a3336aeebf..14b0859211 100644 --- a/compiler/utils/FastStringEnv.hs +++ b/compiler/utils/FastStringEnv.hs @@ -24,7 +24,7 @@ module FastStringEnv ( DFastStringEnv, -- ** Manipulating these environments - mkDFsEnv, emptyDFsEnv, dFsEnvElts, + mkDFsEnv, emptyDFsEnv, dFsEnvElts, lookupDFsEnv ) where import UniqFM @@ -93,3 +93,6 @@ dFsEnvElts = eltsUDFM mkDFsEnv :: [(FastString,a)] -> DFastStringEnv a mkDFsEnv l = listToUDFM l + +lookupDFsEnv :: DFastStringEnv a -> FastString -> Maybe a +lookupDFsEnv = lookupUDFM -- cgit v1.2.1