[project @ 2001-08-22 11:45:06 by sewardj]
[ghc-hetmet.git] / ghc / tests / programs / zhang_ccall / MAIL
1 From: Xiaoming Zhang <X.M.Zhang@uk.ac.swansea>
2 Date: Thu, 26 May 94 16:48:44 BST
3 Message-Id: <1276.9405261548@csterra.swan.ac.uk>
4 To: partain@uk.ac.glasgow.dcs
5 Subject: ghc
6
7 Hi Will,
8
9 Have you got any update for ghc 0.20 recently?  The problem
10 I am experiencing is that I cannot receive values from C
11 subroutines.  The included program highlights the problem.
12 The Haskell program gets a 0 instead of 1.  Any comment?
13 By the way, is these any work going on over there in running
14 Haskell on PVM?
15
16 Regards,
17
18 Xiaoming
19
20 -----------------------
21
22 Haskell program:
23
24 module Main where
25
26 import PreludePrimIO
27
28 main =
29         appendChan stdout (shows res "\n")
30         exit done
31         where
32         res = unsafePerformPrimIO (
33                 ca `thenPrimIO` \r -> returnPrimIO r)
34         ca :: PrimIO Float
35         ca = _ccall_ nn
36
37 C subroutine:
38
39 float nn () {return 1;}
40
41 --------------------