haskell rocks !!!
DESCRIPTION
I executed the code from http://speely.wordpress.com/2010/07/09/parallel-processing-with-haskell/ on my UbuntuTRANSCRIPT
Haskell Rocks !!!
zareac@zareac:~$ ghcghc: no input filesUsage: For basic information, try the `--help' option.zareac@zareac:~$ ghc-profghc-prof: command not foundzareac@zareac:~$ sudo apt-get install ghc ghc-prof cabal-install[sudo] password for zareac: Reading package lists... DoneBuilding dependency tree Reading state information... Donecabal-install is already the newest version.ghc is already the newest version.The following packages were automatically installed and are no longer required: linux-headers-3.2.0-31-generic libutouch-grail1 libunity6 linux-headers-3.2.0-34-generic linux-headers-3.2.0-29-generic linux-headers-3.2.0-31 linux-headers-3.2.0-32 linux-headers-3.2.0-34 linux-headers-3.2.0-29 linux-headers-3.2.0-32-generic linux-headers-3.2.0-34-generic-pae linux-headers-3.2.0-29-generic-pae linux-headers-3.2.0-31-generic-pae libutouch-evemu1 libdee-1.0-1 libutouch-frame1 libutouch-geis1 linux-headers-3.2.0-32-generic-paeUse 'apt-get autoremove' to remove them.The following NEW packages will be installed: ghc-prof0 upgraded, 1 newly installed, 0 to remove and 37 not upgraded.Need to get 39.3 MB of archives.After this operation, 207 MB of additional disk space will be used.Do you want to continue [Y/n]? yGet:1 http://archive.ubuntu.com/ubuntu/ precise/universe ghc-prof i386 7.4.1-1ubuntu2 [39.3 MB]Fetched 39.3 MB in 1min 9s (563 kB/s) Selecting previously unselected package ghc-prof.(Reading database ... 460460 files and directories currently installed.)Unpacking ghc-prof (from .../ghc-prof_7.4.1-1ubuntu2_i386.deb) ...Setting up ghc-prof (7.4.1-1ubuntu2) ...zareac@zareac:~$ ghcghc: no input filesUsage: For basic information, try the `--help' option.zareac@zareac:~$ cd Documents/zareac@zareac:~/Documents$ gedit maths.hs
zareac@zareac:~/Documents$ ghc -O2 --make maths.hs -threaded[1 of 1] Compiling Main ( maths.hs, maths.o )Linking maths ...zareac@zareac:~/Documents$ time ./maths +RTS -N2maths: Using large values for -N is not allowed by default. Link with -rtsopts to allow full control.
real 0m0.004suser 0m0.000ssys 0m0.000szareac@zareac:~/Documents$ gedit maths.hszareac@zareac:~/Documents$ ghc -O2 --make maths.hs -threaded[1 of 1] Compiling Main ( maths.hs, maths.o )Linking maths ...zareac@zareac:~/Documents$ time ./maths +RTS -N2maths: Using large values for -N is not allowed by default. Link with -rtsopts to allow full control.
real 0m0.004suser 0m0.000ssys 0m0.000szareac@zareac:~/Documents$ time ./maths +RTSOPTS -N2A = 8189B = 5040C = 34
real 0m1.864suser 0m1.776ssys 0m0.028s