Hi,
I am playing with greencard a little bit and failed to compile the
examples in the documentation. I am using ghc-4.01 (4-02 refuses to
compile greencard) and GNU CPP version 2.8.1 (i386 GNU/Linux with ELF).
We I make ghc eat the following code (in module Main with a trivial
main
On Fri, 16 Apr 1999 [EMAIL PROTECTED] wrote:
(Btw, does anybody know why ghc4.02 complains about comments starting
with a character different from space (like in ``--:: type'')? This is
certainly not intended, is it?)
Last I heard this was a deliberate feature of Haskell 98 so you can
[EMAIL PROTECTED] wrote:
[...]
%fun mirror :: Polar - Polar
%call ( polarToCart / cartToPolar (int x) (int y))
%code x = -x;
% y = -y;
%result ( polarToCart / cartToPolar (int x) (int y))
The variable names x and y are not "local enough", so you should try:
%fun mirror :: Polar
[EMAIL PROTECTED] wrote:
data Polar = P Int Int deriving Show
polarToCart :: Polar - (Int, Int)
polarToCart (P a b) = (a, b)
cartToPolar :: (Int, Int) - Polar
cartToPolar (a, b) = P a b
%fun mirror :: Polar - Polar
%call ( polarToCart / cartToPolar (int x) (int y))
%code x
Sven Panne [EMAIL PROTECTED] writes:
[EMAIL PROTECTED] wrote:
[...]
%fun mirror :: Polar - Polar
%call ( polarToCart / cartToPolar (int x) (int y))
%code x = -x;
% y = -y;
%result ( polarToCart / cartToPolar (int x) (int y))
The variable names x and y are not "local