summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/StaticPtrTypeFamily.hs
blob: 96a776ecec82acf5f2faa2e1e107f9d1fdb91894 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE FlexibleContexts    #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StaticPointers      #-}
{-# LANGUAGE TypeFamilies        #-}

module StaticPtrTypeFamily where

import Data.Typeable
import GHC.StaticPtr

type family F a

caller :: forall a. (Typeable a, Typeable (F a)) => a -> F a -> ()
caller a fa = deRefStaticPtr (static func) a fa

func :: a -> F a -> ()
func _ _ = ()