{-# LANGUAGE MagicHash, UnboxedTuples #-}
module Clash.GHCi.Util where
import GHC.Exts
import GHC.Types
anyToPtr :: a -> IO (Ptr ())
anyToPtr :: a -> IO (Ptr ())
anyToPtr x :: a
x =
(State# RealWorld -> (# State# RealWorld, Ptr () #)) -> IO (Ptr ())
forall a. (State# RealWorld -> (# State# RealWorld, a #)) -> IO a
IO (\s :: State# RealWorld
s -> case a -> State# RealWorld -> (# State# RealWorld, Addr# #)
forall a. a -> State# RealWorld -> (# State# RealWorld, Addr# #)
anyToAddr# a
x State# RealWorld
s of
(# s' :: State# RealWorld
s', addr :: Addr#
addr #) -> (# State# RealWorld
s', Addr# -> Ptr ()
forall a. Addr# -> Ptr a
Ptr Addr#
addr #)) :: IO (Ptr ())