From b3857b62cb74ef50cbe88ab898aae946ca933365 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 6 Feb 2020 17:31:18 -0500 Subject: [PATCH] base: Drop out-of-date comment The comment in GHC.Base claimed that ($) couldn't be used in that module as it was wired-in. However, this is no longer true; ($) is merely known key and is defined in Haskell (with a RuntimeRep-polymorphic type) in GHC.Base. The one piece of magic that ($) retains is that it a special typing rule to allow type inference with higher-rank types (e.g. `runST $ blah`; see Note [Typing rule for ($)] in TcExpr). --- libraries/base/GHC/Base.hs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs index fc0424a6a4..9e64cf50d1 100644 --- a/libraries/base/GHC/Base.hs +++ b/libraries/base/GHC/Base.hs @@ -1,17 +1,5 @@ {- -NOTA BENE: Do NOT use ($) anywhere in this module! The type of ($) is -slightly magical (it can return unlifted types), and it is wired in. -But, it is also *defined* in this module, with a non-magical type. -GHC gets terribly confused (and *hangs*) if you try to use ($) in this -module, because it has different types in different scenarios. - -This is not a problem in general, because the type ($), being wired in, is not -written out to the interface file, so importing files don't get confused. -The problem is only if ($) is used here. So don't! - ---------------------------------------------- - The overall structure of the GHC Prelude is a bit tricky. a) We want to avoid "orphan modules", i.e. ones with instance -- GitLab