summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/GHC/Base.hs9
-rw-r--r--libraries/ghc-prim/GHC/Magic.hs4
2 files changed, 11 insertions, 2 deletions
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index 2d6e0e4195..35de446ca6 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -83,6 +83,7 @@ Other Prelude modules are much easier with fewer complex dependencies.
, UnboxedTuples
, ExistentialQuantification
, RankNTypes
+ , KindSignatures
#-}
-- -Wno-orphans is needed for things like:
-- Orphan rule: "x# -# x#" ALWAYS forall x# :: Int# -# x# x# = 0
@@ -1287,9 +1288,13 @@ flip f x y = f y x
--
-- It is also useful in higher-order situations, such as @'map' ('$' 0) xs@,
-- or @'Data.List.zipWith' ('$') fs xs@.
+--
+-- Note that @($)@ is levity-polymorphic in its result type, so that
+-- foo $ True where foo :: Bool -> Int#
+-- is well-typed
{-# INLINE ($) #-}
-($) :: (a -> b) -> a -> b
-f $ x = f x
+($) :: forall r a (b :: TYPE r). (a -> b) -> a -> b
+f $ x = f x
-- | Strict (call-by-value) application operator. It takes a function and an
-- argument, evaluates the argument to weak head normal form (WHNF), then calls
diff --git a/libraries/ghc-prim/GHC/Magic.hs b/libraries/ghc-prim/GHC/Magic.hs
index 3dbda1dbd4..2d4de6fb70 100644
--- a/libraries/ghc-prim/GHC/Magic.hs
+++ b/libraries/ghc-prim/GHC/Magic.hs
@@ -25,6 +25,10 @@
module GHC.Magic ( inline, noinline, lazy, oneShot, runRW# ) where
+--------------------------------------------------
+-- See Note [magicIds] in MkId.hs
+--------------------------------------------------
+
import GHC.Prim
import GHC.CString ()
import GHC.Types (RuntimeRep, TYPE)