Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: Trouble compiling haskell platfrom (gdwe...@iue.edu) 2. Re: Trouble compiling haskell platfrom (Jeff Lasslett) 3. Re: Concurrent vs GHC (Mauricio Hernandes) 4. Hackage down? (Lorenzo Bolla) ---------------------------------------------------------------------- Message: 1 Date: Wed, 11 Jul 2012 16:48:13 -0400 From: gdwe...@iue.edu Subject: Re: [Haskell-beginners] Trouble compiling haskell platfrom To: Jeff Lasslett <jeff.lassl...@gmail.com> Cc: Beginners@haskell.org Message-ID: <20120711204813.gg...@tramp.ftrdhcpuser.net> Content-Type: text/plain; charset=us-ascii Hi, On 2012-Jul-11, Jeff Lasslett wrote: > Greetings, > > I'm trying to recompile & reinstall the haskell platform 12.2.0.0. I > have installed it successfully on a prior occasion but I decided to > reinstall as I think I may have messed up my installed packages a bit > while playing around with yesod. I intend to use cabal-dev or > virtualenv for that in future. > > So I thought I'd do a clean install. I blew away my haskell platform > and ghc, both of which were installed in a dir under my home dir. I > also blew away my ~/.cabal/ dir. > > I then reinstalled by ghc 7.4.1 into ~/prg/haskell-platform-12.2.0.0. > > I then unpacked the sources of haskell-platform-12.2.0.0 and > configured it with the prefix set to where ghc is. > > configure finished without error so I ran 'make'. It quits with what > follows. How do I fix this?? > > With thanks, > > Jeff > > > > * Now do "make" followed by "make install" > ************************************************** > jeff@chunks:~/src/haskell-platform-2012.2.0.0$ make > scripts/build.sh > ************************************************** > Scanning system for any installed Haskell Platform components... > > Found: HUnit-1.2.4.2 OpenGL-2.2.3.1 GLUT-2.1.2.1 html-1.0.1.2 > parallel-3.2.0.2 random-1.0.1.1 QuickCheck-2.4.2 stm-2.3 syb-0.3.6.1 > haskell-src-1.0.1.5 text-0.11.2.0 transformers-0.3.0.0 mtl-2.1.1 > fgl-5.4.2.4 parsec-3.1.2 network-2.3.0.13 HTTP-4000.2.3 > regex-base-0.93.2 regex-posix-0.95.1 regex-compat-0.95.1 > xhtml-3000.2.1 cgi-3001.1.7.4 zlib-0.5.3.3 haskell-platform-2012.2.0.0 > > New packages to install: None! All done. > > ************************************************** > Building alex-3.0.1 > "/home/jeff/prg/haskell-platform-12.2.0.0/bin/ghc" "--make" "Setup" > "-o" "Setup" "-package" "Cabal-1.14.0" > Linking Setup ... > "./Setup" "configure" > "--package-db=../../packages/package.conf.inplace" > "--prefix=/home/jeff/prg/haskell-platform-12.2.0.0" > "--with-compiler=/home/jeff/prg/haskell-platform-12.2.0.0/bin/ghc" > "--with-hc-pkg=/home/jeff/prg/haskell-platform-12.2.0.0/bin/ghc-pkg" > "--with-hsc2hs=/home/jeff/prg/haskell-platform-12.2.0.0/bin/hsc2hs" > "--enable-library-profiling" > "--ghc-pkg-option=--package-conf=../../packages/package.conf.inplace" > "--user" > Warning: defaultUserHooks in Setup script is deprecated. > Configuring alex-3.0.1... > "./Setup" "build" > Building alex-3.0.1... > Preprocessing executable 'alex' for alex-3.0.1... > > src/Data/Ranged/RangedSet.hs:64:8: > Could not find module `Test.QuickCheck' > There are files missing in the `QuickCheck-2.4.2' package, > try running 'ghc-pkg check'. > Use -v to see a list of the files searched for. I would suggest start by doing what it says just above: run `ghc-pkg check`. This will give you a list of broken packages. For each such package `P`, run `ghc-pkg unregister P`. Then you can try installing Haskell Platform again, starting with the configure step. For a detailed explanation of what's going on here, see Albert Lai's "Storage and Identification of Cabalized Packages": http://www.vex.net/~trebla/haskell/sicp.xhtml > > Error: > Building the alex-3.0.1 package failed > make: *** [build.stamp] Error 2 > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners -- Gregory D. Weber, Ph. D. : Associate Professor of Informatics / \ Indiana University East 0 : Tel. (765) 973-8420; FAX (765) 973-8550 / \ http://mypage.iu.edu/~gdweber/ 1 [] ------------------------------ Message: 2 Date: Thu, 12 Jul 2012 14:01:12 +1000 From: Jeff Lasslett <jeff.lassl...@gmail.com> Subject: Re: [Haskell-beginners] Trouble compiling haskell platfrom To: gdwe...@iue.edu Cc: Beginners@haskell.org Message-ID: <cak6+hby1quu6ssf8u2oh_pnyb3dcbvl65m5r++3krm6c1tn...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Thanks. That did the trick. On 12 July 2012 06:48, <gdwe...@iue.edu> wrote: > Hi, > > On 2012-Jul-11, Jeff Lasslett wrote: >> Greetings, >> >> I'm trying to recompile & reinstall the haskell platform 12.2.0.0. I >> have installed it successfully on a prior occasion but I decided to >> reinstall as I think I may have messed up my installed packages a bit >> while playing around with yesod. I intend to use cabal-dev or >> virtualenv for that in future. >> >> So I thought I'd do a clean install. I blew away my haskell platform >> and ghc, both of which were installed in a dir under my home dir. I >> also blew away my ~/.cabal/ dir. >> >> I then reinstalled by ghc 7.4.1 into ~/prg/haskell-platform-12.2.0.0. >> >> I then unpacked the sources of haskell-platform-12.2.0.0 and >> configured it with the prefix set to where ghc is. >> >> configure finished without error so I ran 'make'. It quits with what >> follows. How do I fix this?? >> >> With thanks, >> >> Jeff >> >> >> >> * Now do "make" followed by "make install" >> ************************************************** >> jeff@chunks:~/src/haskell-platform-2012.2.0.0$ make >> scripts/build.sh >> ************************************************** >> Scanning system for any installed Haskell Platform components... >> >> Found: HUnit-1.2.4.2 OpenGL-2.2.3.1 GLUT-2.1.2.1 html-1.0.1.2 >> parallel-3.2.0.2 random-1.0.1.1 QuickCheck-2.4.2 stm-2.3 syb-0.3.6.1 >> haskell-src-1.0.1.5 text-0.11.2.0 transformers-0.3.0.0 mtl-2.1.1 >> fgl-5.4.2.4 parsec-3.1.2 network-2.3.0.13 HTTP-4000.2.3 >> regex-base-0.93.2 regex-posix-0.95.1 regex-compat-0.95.1 >> xhtml-3000.2.1 cgi-3001.1.7.4 zlib-0.5.3.3 haskell-platform-2012.2.0.0 >> >> New packages to install: None! All done. >> >> ************************************************** >> Building alex-3.0.1 >> "/home/jeff/prg/haskell-platform-12.2.0.0/bin/ghc" "--make" "Setup" >> "-o" "Setup" "-package" "Cabal-1.14.0" >> Linking Setup ... >> "./Setup" "configure" >> "--package-db=../../packages/package.conf.inplace" >> "--prefix=/home/jeff/prg/haskell-platform-12.2.0.0" >> "--with-compiler=/home/jeff/prg/haskell-platform-12.2.0.0/bin/ghc" >> "--with-hc-pkg=/home/jeff/prg/haskell-platform-12.2.0.0/bin/ghc-pkg" >> "--with-hsc2hs=/home/jeff/prg/haskell-platform-12.2.0.0/bin/hsc2hs" >> "--enable-library-profiling" >> "--ghc-pkg-option=--package-conf=../../packages/package.conf.inplace" >> "--user" >> Warning: defaultUserHooks in Setup script is deprecated. >> Configuring alex-3.0.1... >> "./Setup" "build" >> Building alex-3.0.1... >> Preprocessing executable 'alex' for alex-3.0.1... >> >> src/Data/Ranged/RangedSet.hs:64:8: >> Could not find module `Test.QuickCheck' >> There are files missing in the `QuickCheck-2.4.2' package, >> try running 'ghc-pkg check'. >> Use -v to see a list of the files searched for. > > I would suggest start by doing what it says just above: > run `ghc-pkg check`. > > This will give you a list of broken packages. > For each such package `P`, run `ghc-pkg unregister P`. > > Then you can try installing Haskell Platform again, > starting with the configure step. > > For a detailed explanation of what's going on here, > see Albert Lai's "Storage and Identification of Cabalized Packages": > > http://www.vex.net/~trebla/haskell/sicp.xhtml > > >> >> Error: >> Building the alex-3.0.1 package failed >> make: *** [build.stamp] Error 2 >> >> _______________________________________________ >> Beginners mailing list >> Beginners@haskell.org >> http://www.haskell.org/mailman/listinfo/beginners > > -- > Gregory D. Weber, Ph. D. : > Associate Professor of Informatics / \ > Indiana University East 0 : > Tel. (765) 973-8420; FAX (765) 973-8550 / \ > http://mypage.iu.edu/~gdweber/ 1 [] ------------------------------ Message: 3 Date: Thu, 12 Jul 2012 14:42:50 +0900 From: Mauricio Hernandes <maukeshig...@gmail.com> Subject: Re: [Haskell-beginners] Concurrent vs GHC To: Bob Hutchison <hutch-li...@recursive.ca> Cc: beginners@haskell.org Message-ID: <caoons7z9oybrbwldo0caxhpxvfstwwhpdlsvpfqmotrhgjt...@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Hi Guys, thanks again for the time reading this thread. I was busy so I couldn't modify the code, but now it looks like this: main = do finished <- atomically $ newTChan chan <- atomically $ newTChan f <- openOffline "filename" forkIO $ writeFile chan forkIO $ reaFile f chan finished a <- readTChan finished show a So chan is the variable for communication and finished the variable used to readFile tell the main thread that the file is over, It seems more neat than the previous code, but I have a hard time understanding the sentence "...you have to manually specify the number of threads that you opened..." in Felipe's email. What does it mean? How do I specify automatically how many threads do I want? Thanks a lot Mau :) On Mon, Jul 2, 2012 at 10:18 PM, Bob Hutchison <hutch-li...@recursive.ca>wrote: > > On 2012-07-02, at 9:10 AM, Bob Hutchison wrote: > > > On 2012-06-30, at 1:51 PM, Mauricio Hernandes wrote: > > Eternal Gratitude for the help, it's working perfectly, I will consider > the exceptions and other stuff now. > > the code looks like this now > > > import System.IO > import Control.Concurrent > import Data.List > import Control.Monad > > main = do > finished <- newEmptyMVar > input <- newMVar [1..30000] > ia <- newEmptyMVar > ib <- newEmptyMVar > ic <- newEmptyMVar > > forkIO $ do x <- readMVar input > putMVar ia x > putMVar finished () > > forkIO $ do a <- readMVar ia > putMVar ib ( sum a ) > putMVar finished () > > forkIO $ do a <- readMVar ia > putMVar ic ( reverse a ) > putMVar finished () > > b <- readMVar ib > c <- readMVar ic > writeFile "somaEprod.txt" (show b ++ "\n") > appendFile "somaEprod.txt" (show c) > replicateM_ 3 (takeMVar finished) > > > Just another Haskell beginner here, so beware... > > You've moved the readMVar out of a thread into the application. This means > (I think) that you are waiting for values in both ib and ic in the > application (rather than a fourth thread). In your specific program, for > these to have values require that all three threads have completed so you > don't need the finished MVar anymore. However, this is pretty fragile being > completely dependent on the MVars being set exactly once as the threads > complete (so if you modify the code you have to be careful). The found > solution is also fragile as > > ^^^^^ finished (sorry) > > Felipe says in his post. I don't know what those libraries Felipe > mentioned are but I think I'd be looking for them right about now if I were > you :-) > > Cheers, > Bob > > > > > > Valeu > Mauricio > > On Sun, Jul 1, 2012 at 12:24 AM, Felipe Almeida Lessa < > felipe.le...@gmail.com> wrote: > >> Your application is exiting before your forkIOs get a chance to >> execute. Instead of >> >> forkIO $ do >> ... >> forkIO $ do >> ... >> forkIO $ do >> ... >> >> use something like >> >> finished <- newEmptyMVar >> >> forkIO $ do >> ... >> putMVar finished () >> >> forkIO $ do >> ... >> putMVar finished () >> >> forkIO $ do >> ... >> putMVar finished () >> >> replicateM_ 3 (takeMVar finished) >> >> Doing so will avoid your program to exit until all threads have finished. >> >> Note that the code above is extremely fragile: doesn't handle >> exceptions, you have to manually specify the number of threads that >> you opened, etc. These are abstracted by some libraries on Hackage >> that you may use later for Real World Code (TM). >> >> Cheers, =) >> >> -- >> Felipe. >> > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners > > > ---- > Bob Hutchison > Recursive Design Inc. > http://www.recursive.ca/ > weblog: http://xampl.com/so > > > > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners > > > ---- > Bob Hutchison > Recursive Design Inc. > http://www.recursive.ca/ > weblog: http://xampl.com/so > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120712/9aafe54b/attachment-0001.htm> ------------------------------ Message: 4 Date: Thu, 12 Jul 2012 08:51:48 +0100 From: Lorenzo Bolla <lbo...@gmail.com> Subject: [Haskell-beginners] Hackage down? To: beginners@haskell.org Message-ID: <cadjgtrxnyhrn5abmmdim5loykswgyhumjavrk76qcwhesb1...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Is hackage.haskell.org down? cabal update times out here... How do you guys work around this? It seems to happen pretty often. L. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120712/f9b63c4b/attachment.htm> ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 49, Issue 12 *****************************************