diff options
| author | Dr. ERDI Gergo <gergo@erdi.hu> | 2014-12-20 16:44:20 +0800 |
|---|---|---|
| committer | Dr. ERDI Gergo <gergo@erdi.hu> | 2014-12-20 16:44:20 +0800 |
| commit | 0f1f3e1db73fc528ebd53938e2c39af62263c739 (patch) | |
| tree | 1262ae5a0bfaff503230f48affd93d6dd9a379e0 /compiler/iface/MkIface.lhs | |
| parent | 846d93023ef94217620caab56d41cafb73c51a3a (diff) | |
| download | haskell-wip/pattern-synonym-backport.tar.gz | |
Rejig builders for pattern synonyms, especially unlifted oneswip/pattern-synonym-backport
When a pattern synonym is for an unlifted pattern, its "builder" would
naturally be a top-level unlifted binding, which isn't allowed. So we
give it an extra Void# argument.
Our Plan A involved then making *two* Ids for these builders, with
some consequential fuss in the desugarer. This was more pain than I
liked, so I've re-jigged it.
* There is just one builder for a pattern synonym.
* It may have an extra Void# arg, but this decision is signalled
by the Bool in the psBuilder field.
I did the same for the psMatcher field.
Both Bools are serialised into interface files, so there is
absolutely no doubt whether that extra Void# argument is required.
* I renamed "wrapper" to "builder". We have too may "wrappers"
* In order to deal with typecchecking occurrences of P in expressions,
I refactored the tcInferId code in TcExpr.
All of this allowed me to revert 5fe872
"Apply compulsory unfoldings during desugaring, except for `seq` which is special."
which turned out to be a rather messy hack in DsBinds
(cherry picked from commit e876208117a34fb58f7f1e470de2f954b3ca303d)
Diffstat (limited to 'compiler/iface/MkIface.lhs')
| -rw-r--r-- | compiler/iface/MkIface.lhs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index 32b43875b3..97efc365fb 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -1488,8 +1488,8 @@ dataConToIfaceDecl dataCon patSynToIfaceDecl :: PatSyn -> IfaceDecl patSynToIfaceDecl ps = IfacePatSyn { ifName = getOccName . getName $ ps - , ifPatMatcher = matcher - , ifPatWrapper = wrapper + , ifPatMatcher = to_if_pr (patSynMatcher ps) + , ifPatBuilder = fmap to_if_pr (patSynBuilder ps) , ifPatIsInfix = patSynIsInfix ps , ifPatUnivTvs = toIfaceTvBndrs univ_tvs' , ifPatExTvs = toIfaceTvBndrs ex_tvs' @@ -1502,10 +1502,7 @@ patSynToIfaceDecl ps (univ_tvs, ex_tvs, prov_theta, req_theta, args, rhs_ty) = patSynSig ps (env1, univ_tvs') = tidyTyVarBndrs emptyTidyEnv univ_tvs (env2, ex_tvs') = tidyTyVarBndrs env1 ex_tvs - - matcher = idName (patSynMatcher ps) - wrapper = fmap idName (patSynWrapper ps) - + to_if_pr (id, needs_dummy) = (idName id, needs_dummy) -------------------------- coAxiomToIfaceDecl :: CoAxiom br -> IfaceDecl |
