ed84169338276ec100043862578df0114975211c
[ghc-hetmet.git] / ghc / lib / std / PrelCCall.lhs
1 %
2 % (c) The AQUA Project, Glasgow University, 1994-1996
3 %
4
5 \section[PrelCCall]{Module @PrelCCall@}
6
7 \begin{code}
8 {-# OPTIONS -fno-implicit-prelude #-}
9
10 module PrelCCall (
11         CCallable(..),
12         CReturnable(..),
13
14         Word(..),
15         Word64(..),
16         Int64(..)
17    ) where
18
19 import PrelBase
20 import PrelGHC
21 \end{code}
22
23 %*********************************************************
24 %*                                                      *
25 \subsection{Classes @CCallable@ and @CReturnable@}
26 %*                                                      *
27 %*********************************************************
28
29 \begin{code}
30 instance CCallable Char
31 instance CCallable   Char#
32 instance CReturnable Char
33
34 instance CCallable   Int
35 instance CCallable   Int#
36 instance CReturnable Int
37
38 -- DsCCall knows how to pass strings...
39 instance CCallable   [Char]
40
41 instance CCallable   Float
42 instance CCallable   Float#
43 instance CReturnable Float
44
45 instance CCallable   Double
46 instance CCallable   Double#
47 instance CReturnable Double
48
49 data Word = W# Word#       deriving (Eq, Ord) -- Glasgow extension
50
51 instance CCallable Word
52 instance CCallable Word#
53 instance CReturnable Word
54
55
56 data Word64 = W64# Word64# --deriving (Eq, Ord) -- Glasgow extension
57 data Int64  = I64# Int64#  --deriving (Eq, Ord) -- Glasgow extension
58
59 instance CCallable   Word64
60 instance CCallable   Word64#
61 instance CReturnable Word64
62
63 instance CCallable   Int64
64 instance CCallable   Int64#
65 instance CReturnable Int64
66
67 instance CReturnable () -- Why, exactly?
68 \end{code}
69