Hi, I have three modules which all use the same (or some of the same) %dis directives; I'd like to pull these out into their own file (a module called "MyDIS" or something), but I can't figure out how to get green-card to look at those definitions (I've `import`ed it in the modules that need it and put it's directory in the search path with -i). Unfortunately, even so it complains that it doesn't know how to marshall my datatypes. Any suggestions? - Hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
Something like:
foo$ cat Foo.gc
module Foo where
import StdDIS
%dis foo x = char x
foo$ cat Bar.gc
module Bar where
import StdDIS
import Foo
%fun f :: Foo -> IO ()
foo$ green-card -i/path/to/green-card/lib/ghc -tffi Bar.gc
foo$
hth
--sigbjorn
----- Original Message -----
From: "Hal Daume III"
Hi,
I have three modules which all use the same (or some of the same) %dis directives; I'd like to pull these out into their own file (a module called "MyDIS" or something), but I can't figure out how to get green-card to look at those definitions (I've `import`ed it in the modules that need it and put it's directory in the search path with -i). Unfortunately, even so it complains that it doesn't know how to marshall my datatypes.
Any suggestions?
- Hal
-- Hal Daume III
"Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Ah, my problem was that I was using the extension ".ghs" on my "Foo" file and it expected ".gc". Thanks. -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume On Wed, 29 May 2002, Sigbjorn Finne wrote:
Something like:
foo$ cat Foo.gc module Foo where import StdDIS %dis foo x = char x
foo$ cat Bar.gc module Bar where import StdDIS import Foo %fun f :: Foo -> IO ()
foo$ green-card -i/path/to/green-card/lib/ghc -tffi Bar.gc foo$
hth --sigbjorn
----- Original Message ----- From: "Hal Daume III"
To: ; "GHC Users Mailing List" Sent: Wednesday, May 29, 2002 16:41 Subject: specifying common 'dis's in greencard Hi,
I have three modules which all use the same (or some of the same) %dis directives; I'd like to pull these out into their own file (a module called "MyDIS" or something), but I can't figure out how to get green-card to look at those definitions (I've `import`ed it in the modules that need it and put it's directory in the search path with -i). Unfortunately, even so it complains that it doesn't know how to marshall my datatypes.
Any suggestions?
- Hal
-- Hal Daume III
"Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
ok, the -s option lets you expand the list of file suffixes used,
i.e., "-sghc" would take care of it your case.
--sigbjorn
----- Original Message -----
From: "Hal Daume III"
Ah, my problem was that I was using the extension ".ghs" on my "Foo" file and it expected ".gc".
Thanks.
-- Hal Daume III
"Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
On Wed, 29 May 2002, Sigbjorn Finne wrote:
Something like:
foo$ cat Foo.gc module Foo where import StdDIS %dis foo x = char x
foo$ cat Bar.gc module Bar where import StdDIS import Foo %fun f :: Foo -> IO ()
foo$ green-card -i/path/to/green-card/lib/ghc -tffi Bar.gc foo$
hth --sigbjorn
----- Original Message ----- From: "Hal Daume III"
To: ; "GHC Users Mailing List" Sent: Wednesday, May 29, 2002 16:41 Subject: specifying common 'dis's in greencard Hi,
I have three modules which all use the same (or some of the same) %dis directives; I'd like to pull these out into their own file (a module called "MyDIS" or something), but I can't figure out how to get green-card to look at those definitions (I've `import`ed it in the modules that need it and put it's directory in the search path with -i). Unfortunately, even so it complains that it doesn't know how to marshall my datatypes.
Any suggestions?
- Hal
-- Hal Daume III
"Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Hi, I have three modules which all use the same (or some of the same) %dis directives; I'd like to pull these out into their own file (a module called "MyDIS" or something), but I can't figure out how to get green-card to look at those definitions (I've `import`ed it in the modules that need it and put it's directory in the search path with -i). Unfortunately, even so it complains that it doesn't know how to marshall my datatypes.
Any suggestions?
It sounds like you're doing the right thing (i.e., put it in another GreenCard module and then import it - same way we do with StdDIS) so I think you should distill the essence of the problem into a couple of 5-10 line modules and send in a bug report (or realize what you were doing wrong in the process). -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/
participants (3)
-
Alastair Reid -
Hal Daume III -
Sigbjorn Finne