RE: Silly IO problem

2005-11-04 Thread Simon Marlow
On 03 November 2005 12:57, skaller wrote:

 On Thu, 2005-11-03 at 09:49 +0100, Mirko Rahn wrote:
 It prints n, rather than tak(3n,2n,n).
 
 ??? No:
 
 *Main :set args 0
 *Main main
 0.0
 *Main :set args 1
 *Main main
 2.0
 *Main :set args 2
 *Main main
 3.0
 *Main :set args 3
 *Main main
 6.0
 
 The same with some versions of ghc.
 
 Ah .. it seems to be a bug in gcc 4.0
 
 The Glorious Glasgow Haskell Compilation System, version 6.4
 [running on Ubuntu which uses Debian package]
 
 gcc (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
 x86_64
 
 Summary: gcc does not work with GHC 6.4 on x86_64 with
 optimisation higher than -O1
 
 Perhaps the Evil Mangler is not working, or, possibly
 the version isn't even registered.

Thanks for the report, I'll look into gcc 4.x before we release 6.4.2.

Cheers,
Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Silly IO problem

2005-11-03 Thread Christian Maeder

I don't see your problem. (I've put your code into the file Tac.hs)

Christian

[EMAIL PROTECTED]:~/haskell/examples ghc --make -o tac Tac.hs
Chasing modules from: Tac.hs
Compiling Main ( Tac.hs, Tac.o )
Linking ...
[EMAIL PROTECTED]:~/haskell/examples ./tac 5
10.0


skaller wrote:

This code doesn't work:

import System(getArgs)

main = do n - getArgs = readIO.head
  putStrLn (show (tak (3*n) (2*n) n))

tak :: Float - Float - Float - Float
tak x y z | y=x  = z
  | otherwise = tak (tak (x-1) y z) (tak (y-1) z x) (tak (z-1) x
y)
--
It prints n, rather than tak(3n,2n,n). Can someone give me
the right encoding please?



___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Silly IO problem

2005-11-03 Thread skaller
On Thu, 2005-11-03 at 09:49 +0100, Mirko Rahn wrote:
  It prints n, rather than tak(3n,2n,n).
 
 ??? No:
 
 *Main :set args 0
 *Main main
 0.0
 *Main :set args 1
 *Main main
 2.0
 *Main :set args 2
 *Main main
 3.0
 *Main :set args 3
 *Main main
 6.0
 
 The same with some versions of ghc.

Ah .. it seems to be a bug in gcc 4.0

The Glorious Glasgow Haskell Compilation System, version 6.4
[running on Ubuntu which uses Debian package]

gcc (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
x86_64

Summary: gcc does not work with GHC 6.4 on x86_64 with
optimisation higher than -O1

Perhaps the Evil Mangler is not working, or, possibly
the version isn't even registered. 

--
[EMAIL PROTECTED]:/work/felix/flx$ ghc -O3 -fvia-C -optc -O3 -o
speed/exes/ghc/takfp speed/src/haskell/takfp.hs

[EMAIL PROTECTED]:/work/felix/flx/speed/exes/ghc$ ./takfp 8
8.0

[EMAIL PROTECTED]:/work/felix/flx$ ghc -fvia-C -o speed/exes/ghc/takfp
speed/src/haskell/takfp.hs
[EMAIL PROTECTED]:/work/felix/flx$ speed/exes/ghc/takfp 8 9.0
[EMAIL PROTECTED]:/work/felix/flx$ speed/exes/ghc/takfp 3
6.0

[EMAIL PROTECTED]:/work/felix/flx$ ghc -O3 -fvia-C -optc -O2 -o
speed/exes/ghc/takfp speed/src/haskell/takfp.hs
[EMAIL PROTECTED]:/work/felix/flx$ speed/exes/ghc/takfp 3 
3.0

[EMAIL PROTECTED]:/work/felix/flx$ ghc -O3 -fvia-C -optc -O1 -o
speed/exes/ghc/takfp speed/src/haskell/takfp.hs
[EMAIL PROTECTED]:/work/felix/flx$ speed/exes/ghc/takfp 3
6.0


-- 
John Skaller skaller at users dot sf dot net
Felix, successor to C++: http://felix.sf.net

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Silly IO problem

2005-11-02 Thread skaller
This code doesn't work:

import System(getArgs)

main = do n - getArgs = readIO.head
  putStrLn (show (tak (3*n) (2*n) n))

tak :: Float - Float - Float - Float
tak x y z | y=x  = z
  | otherwise = tak (tak (x-1) y z) (tak (y-1) z x) (tak (z-1) x
y)
--
It prints n, rather than tak(3n,2n,n). Can someone give me
the right encoding please?

-- 
John Skaller skaller at users dot sf dot net
Felix, successor to C++: http://felix.sf.net

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users