shithub: MicroHs

ref: b047dd65e0c62c2c6a8b019715aa5cff6fa39f7f
dir: /lib/Foreign/Ptr.hs/

View raw version
module Foreign.Ptr(Ptr, nullPtr) where
import Primitives
import Data.Word
import Data.Eq
import Data.Function
import Text.Show

instance forall a . Eq (Ptr a) where
  p == q  =  primPtrToWord p == primPtrToWord q

instance forall a . Show (Ptr a) where
  showsPrec _ p = showString "PTR#" . showsPrec 0 (primPtrToWord p)

nullPtr :: forall a . Ptr a
nullPtr = primWordToPtr 0