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