greencard example does not compile

1999-04-16 Thread fis
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 function):

Re: greencard example does not compile

1999-04-16 Thread D. Tweed
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 defi

Re: greencard example does not compile

1999-04-16 Thread Sven Panne
[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

Re: greencard example does not compile

1999-04-16 Thread Michael Hobbs
[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 > (in

Re: greencard example does not compile

1999-04-16 Thread Matthias Fischmann
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