Legacy Removal
~~~~~~~~~~~~~~
The following features have been consigned to the bit bucket:
_ccall_
_casm_
``....'' (lit-lits)
the CCallable class
the CReturnable class
The source file is GHC.Prim.hi-boot, which is just
copied to make GHC.Prim.hi
The source file is GHC.Prim.hi-boot, which is just
copied to make GHC.Prim.hi
- Classes: CCallable, CReturnable
-
GHC.Base Classes: Eq, Ord, Functor, Monad
Types: list, (), Int, Bool, Ordering, Char, String
GHC.Base Classes: Eq, Ord, Functor, Monad
Types: list, (), Int, Bool, Ordering, Char, String
%*********************************************************
%* *
%*********************************************************
%* *
-\subsection{CCallable instances}
-%* *
-%*********************************************************
-
-Defined here to avoid orphans
-
-\begin{code}
-instance CCallable Char
-instance CReturnable Char
-
-instance CCallable Int
-instance CReturnable Int
-
-instance CReturnable () -- Why, exactly?
-\end{code}
-
-
-%*********************************************************
-%* *
\subsection{Generics}
%* *
%*********************************************************
\subsection{Generics}
%* *
%*********************************************************
-- | Double-precision floating point numbers.
data Double = D# Double#
-- | Double-precision floating point numbers.
data Double = D# Double#
-
-instance CCallable Float
-instance CReturnable Float
-
-instance CCallable Double
-instance CReturnable Double
data Int8 = I8# Int# deriving (Eq, Ord)
-- ^ 8-bit signed integer type
data Int8 = I8# Int# deriving (Eq, Ord)
-- ^ 8-bit signed integer type
-instance CCallable Int8
-instance CReturnable Int8
-
instance Show Int8 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
instance Show Int8 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
data Int16 = I16# Int# deriving (Eq, Ord)
-- ^ 16-bit signed integer type
data Int16 = I16# Int# deriving (Eq, Ord)
-- ^ 16-bit signed integer type
-instance CCallable Int16
-instance CReturnable Int16
-
instance Show Int16 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
instance Show Int16 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
-instance CCallable Int32
-instance CReturnable Int32
-
instance Real Int32 where
toRational x = toInteger x % 1
instance Real Int32 where
toRational x = toInteger x % 1
-instance CCallable Int64
-instance CReturnable Int64
-
instance Real Int64 where
toRational x = toInteger x % 1
instance Real Int64 where
toRational x = toInteger x % 1
minusPtr :: Ptr a -> Ptr b -> Int
minusPtr (Ptr a1) (Ptr a2) = I# (minusAddr# a1 a2)
minusPtr :: Ptr a -> Ptr b -> Int
minusPtr (Ptr a1) (Ptr a2) = I# (minusAddr# a1 a2)
-instance CCallable (Ptr a)
-instance CReturnable (Ptr a)
-
------------------------------------------------------------------------
-- Function pointers for the default calling convention.
------------------------------------------------------------------------
-- Function pointers for the default calling convention.
-- |Casts a 'Ptr' to a 'FunPtr'
castPtrToFunPtr :: Ptr a -> FunPtr b
castPtrToFunPtr (Ptr addr) = FunPtr addr
-- |Casts a 'Ptr' to a 'FunPtr'
castPtrToFunPtr :: Ptr a -> FunPtr b
castPtrToFunPtr (Ptr addr) = FunPtr addr
-
-instance CCallable (FunPtr a)
-instance CReturnable (FunPtr a)
-
data StablePtr a = StablePtr (StablePtr# a)
data StablePtr a = StablePtr (StablePtr# a)
-instance CCallable (StablePtr a)
-instance CReturnable (StablePtr a)
-
newStablePtr :: a -> IO (StablePtr a)
newStablePtr a = IO $ \ s ->
case makeStablePtr# a s of (# s', sp #) -> (# s', StablePtr sp #)
newStablePtr :: a -> IO (StablePtr a)
newStablePtr a = IO $ \ s ->
case makeStablePtr# a s of (# s', sp #) -> (# s', StablePtr sp #)
-- |A 'Word' is an unsigned integral type, with the same size as 'Int'.
data Word = W# Word# deriving (Eq, Ord)
-- |A 'Word' is an unsigned integral type, with the same size as 'Int'.
data Word = W# Word# deriving (Eq, Ord)
-instance CCallable Word
-instance CReturnable Word
-
instance Show Word where
showsPrec p x = showsPrec p (toInteger x)
instance Show Word where
showsPrec p x = showsPrec p (toInteger x)
data Word8 = W8# Word# deriving (Eq, Ord)
-- ^ 8-bit unsigned integer type
data Word8 = W8# Word# deriving (Eq, Ord)
-- ^ 8-bit unsigned integer type
-instance CCallable Word8
-instance CReturnable Word8
-
instance Show Word8 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
instance Show Word8 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
data Word16 = W16# Word# deriving (Eq, Ord)
-- ^ 16-bit unsigned integer type
data Word16 = W16# Word# deriving (Eq, Ord)
-- ^ 16-bit unsigned integer type
-instance CCallable Word16
-instance CReturnable Word16
-
instance Show Word16 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
instance Show Word16 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
-instance CCallable Word32
-instance CReturnable Word32
-
instance Show Word32 where
#if WORD_SIZE_IN_BITS < 33
showsPrec p x = showsPrec p (toInteger x)
instance Show Word32 where
#if WORD_SIZE_IN_BITS < 33
showsPrec p x = showsPrec p (toInteger x)
-instance CCallable Word64
-instance CReturnable Word64
-
instance Show Word64 where
showsPrec p x = showsPrec p (toInteger x)
instance Show Word64 where
showsPrec p x = showsPrec p (toInteger x)