summaryrefslogtreecommitdiff
path: root/libraries/ghc-prim/GHC/Magic.hs
blob: b450e79b39dd7bc94c8a50488dc157a3ba34ab55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-----------------------------------------------------------------------------
-- |
-- Module      :  GHC.Magic
-- Copyright   :  (c) The University of Glasgow 2009
-- License     :  see libraries/ghc-prim/LICENSE
--
-- Maintainer  :  cvs-ghc@haskell.org
-- Stability   :  internal
-- Portability :  non-portable (GHC Extensions)
--
-- GHC magic.
-- Use GHC.Exts from the base package instead of importing this
-- module directly.
--
-----------------------------------------------------------------------------

{-# OPTIONS_GHC -XNoImplicitPrelude #-}

module GHC.Magic (inline) where

-- | The call '(inline f)' reduces to 'f', but 'inline' has a BuiltInRule
-- that tries to inline 'f' (if it has an unfolding) unconditionally
-- The 'NOINLINE' pragma arranges that inline only gets inlined (and
-- hence eliminated) late in compilation, after the rule has had
-- a good chance to fire.
inline :: a -> a
{-# NOINLINE[0] inline #-}
inline x = x