summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/StaticPtr.hs
blob: 41bf6231ccfd2b63c0df169a7443fe42fde487f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE StaticPointers #-}

module StaticPtr where

import GHC.StaticPtr

topLevelStatic :: StaticPtr String
topLevelStatic = static "this is a top-level"

nestedStatic :: (StaticPtr String, Int)
nestedStatic = (s, 42)
  where
    s = static "nested static"
    {-# NOINLINE s #-}

s1 :: StaticPtr Int
s1 = static 3

s2 :: StaticPtr String
s2 = static "hello world"