diff options
author | Facundo DomÃnguez <facundo.dominguez@tweag.io> | 2017-01-09 14:29:32 -0300 |
---|---|---|
committer | Facundo DomÃnguez <facundo.dominguez@tweag.io> | 2017-01-13 17:37:25 -0300 |
commit | 13a85211040f67977d2a2371f4087d1d2ebf4de4 (patch) | |
tree | 1f0edd5ad5619966da1d631ac9458c617f591b73 /libraries/base/GHC/StaticPtr | |
parent | dde63e00fcfd6baba6d06b8be80a8cd34cc86377 (diff) | |
download | haskell-13a85211040f67977d2a2371f4087d1d2ebf4de4.tar.gz |
Desugar static forms to makeStatic calls.
Summary:
Using makeStatic instead of applications of the StaticPtr data
constructor makes possible linting core when unboxing strict
fields.
Test Plan: ./validate
Reviewers: simonpj, goldfire, austin, bgamari, hvr
Reviewed By: simonpj
Subscribers: RyanGlScott, mboes, thomie
Differential Revision: https://phabricator.haskell.org/D2930
GHC Trac Issues: #12622
Diffstat (limited to 'libraries/base/GHC/StaticPtr')
-rw-r--r-- | libraries/base/GHC/StaticPtr/Internal.hs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libraries/base/GHC/StaticPtr/Internal.hs b/libraries/base/GHC/StaticPtr/Internal.hs new file mode 100644 index 0000000000..6605f39b97 --- /dev/null +++ b/libraries/base/GHC/StaticPtr/Internal.hs @@ -0,0 +1,27 @@ +-- | +-- Module : GHC.StaticPtr +-- Copyright : (C) 2016 I/O Tweag +-- License : see libraries/base/LICENSE +-- +-- Maintainer : cvs-ghc@haskell.org +-- Stability : internal +-- Portability : non-portable (GHC Extensions) +-- +-- Internal definitions needed for compiling static forms. +-- + +-- By omitting interface pragmas, we drop the strictness annotations +-- which otherwise would bias GHC to conclude that any code using +-- the static form would fail. +{-# OPTIONS_GHC -fomit-interface-pragmas #-} +module GHC.StaticPtr.Internal (makeStatic) where + +import GHC.StaticPtr(StaticPtr) + +-- 'makeStatic' should never be called by the user. +-- See Note [Grand plan for static forms] in StaticPtrTable. + +makeStatic :: (Int, Int) -> a -> StaticPtr a +makeStatic (line, col) _ = + error $ "GHC bug - makeStatic: Unresolved static form at line " + ++ show line ++ ", column " ++ show col ++ "." |