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. Compiling afrob from Yampa (Nathan Huesken) 2. Re: Compiling afrob from Yampa (Daniel Fischer) 3. one element tuple (bitur mail) 4. Re: one element tuple (Daniel Fischer) 5. hPutChar: invalid argument (Invalid or incomplete multibyte or wide character (Erik de Castro Lopo) 6. Re: hPutChar: invalid argument (Invalid or incomplete multibyte or wide character (Daniel Fischer) ---------------------------------------------------------------------- Message: 1 Date: Sat, 12 Jun 2010 15:11:37 -0400 From: Nathan Huesken <hask...@lonely-star.org> Subject: [Haskell-beginners] Compiling afrob from Yampa To: Biginners Haskell Mailinglist <beginners@haskell.org> Message-ID: <20100612151137.69915...@samzwo> Content-Type: text/plain; charset=US-ASCII Hi, I am trying to learn yampa and downloaded the package, also containing afrob from the homepage. I installed arrows and HGL over cabal. Now I go into the afrob directory and type make, I get: make -C src make[1]: Entering directory `/home/ls/tmp/Yampa-0.9.1/afrob-0.2/src' make -C Common make[2]: Entering directory `/home/ls/tmp/Yampa-0.9.1/afrob-0.2/src/Common' ghc -M -optdep-f -optdep.hs_dependences -optdep--exclude-directory=/usr/local/lib/ghc/imports/arrow:/usr/local/lib/ghc/imports/afrp -fglasgow-exts -O -package lang -i/usr/local/lib/ghc/imports/arrow:/usr/local/lib/ghc/imports/afrp AFrob.hs AFrobDiagnostics.hs AFrobPhysicalDimensions.hs AFrobRobotIO.hs AFrobRobotSimFake.hs || (rm -f .hs_dependences ; exit 1) on the commandline: Warning: -optdep-f is deprecated: Use -dep-makefile instead <command line>: unknown package: lang ghc -c -fglasgow-exts -O -package lang -i/usr/local/lib/ghc/imports/arrow:/usr/local/lib/ghc/imports/afrp -o AFrob.o AFrob.hs <command line>: unknown package: lang make[2]: *** [AFrob.o] Error 1 make[2]: Leaving directory `/home/ls/tmp/Yampa-0.9.1/afrob-0.2/src/Common' make[1]: *** [Common] Error 2 make[1]: Leaving directory `/home/ls/tmp/Yampa-0.9.1/afrob-0.2/src' make: *** [src] Error 2 So I suppose I am missing the "lang" package ?!? How do I get it? Thanks! Nathan ------------------------------ Message: 2 Date: Sat, 12 Jun 2010 21:42:47 +0200 From: Daniel Fischer <daniel.is.fisc...@web.de> Subject: Re: [Haskell-beginners] Compiling afrob from Yampa To: beginners@haskell.org Message-ID: <201006122142.48078.daniel.is.fisc...@web.de> Content-Type: text/plain; charset="iso-8859-1" On Saturday 12 June 2010 21:11:37, Nathan Huesken wrote: > Hi, > > I am trying to learn yampa and downloaded the package, also containing > afrob from the homepage. I installed arrows and HGL over cabal. I think you should have installed Yampa via cabal, too, cabal install Yampa would've gotten you Yampa-0.9.2.3 > Now I go into the afrob directory and type make, I get: > > make -C src > make[1]: Entering directory `/home/ls/tmp/Yampa-0.9.1/afrob-0.2/src' > make -C Common > make[2]: Entering directory > `/home/ls/tmp/Yampa-0.9.1/afrob-0.2/src/Common' ghc -M -optdep-f > -optdep.hs_dependences > -optdep--exclude-directory=/usr/local/lib/ghc/imports/arrow:/usr/local/l >ib/ghc/imports/afrp -fglasgow-exts -O -package lang > -i/usr/local/lib/ghc/imports/arrow:/usr/local/lib/ghc/imports/afrp > AFrob.hs AFrobDiagnostics.hs AFrobPhysicalDimensions.hs AFrobRobotIO.hs > AFrobRobotSimFake.hs || (rm -f .hs_dependences ; > exit 1) > > on the commandline: > Warning: -optdep-f is deprecated: Use -dep-makefile instead > <command line>: unknown package: lang > ghc -c -fglasgow-exts -O -package lang > -i/usr/local/lib/ghc/imports/arrow:/usr/local/lib/ghc/imports/afrp -o > AFrob.o AFrob.hs <command line>: unknown package: lang make[2]: *** > [AFrob.o] Error 1 make[2]: Leaving directory > `/home/ls/tmp/Yampa-0.9.1/afrob-0.2/src/Common' make[1]: *** [Common] > Error 2 make[1]: Leaving directory > `/home/ls/tmp/Yampa-0.9.1/afrob-0.2/src' make: *** [src] Error 2 > > So I suppose I am missing the "lang" package ?!? How do I get it? I think maybe "lang" was a package way back in ancient times. >From a short look at the imports in afrob, it might be what now is haskell98. Considering the homepage says "Version 0.9.1 is a minor update of 0.9, including a version of HGL that should compile with GHC 5.04.1" I don't think it will be very easy to get it going now, too many API changes in the meantime. It also mentions the package concurrent, which doesn't exist either. You can try making it work by removing explicit packages from the ghc- invocations in the makefiles and adding the --make flag > > Thanks! > Nathan ------------------------------ Message: 3 Date: Sat, 12 Jun 2010 16:09:48 -0400 From: bitur mail <biturm...@gmail.com> Subject: [Haskell-beginners] one element tuple To: beginners@haskell.org Message-ID: <aanlktinxinchejbna1mo7iwzsqpoloft9xk_pthqk...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Hello, This is a dumb question but ... I'm just starting with the book Real World Haskell, and in chapter 2 it mentions that "Haskell doesn't have a notion of a one-element tuple". I am confused by this because I type, for example, (143), into the interpreter and it does not complain. What does Haskell consider (143) to be? Thanks :) DG -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/beginners/attachments/20100612/1c9d76a0/attachment-0001.html ------------------------------ Message: 4 Date: Sat, 12 Jun 2010 22:23:24 +0200 From: Daniel Fischer <daniel.is.fisc...@web.de> Subject: Re: [Haskell-beginners] one element tuple To: beginners@haskell.org Message-ID: <201006122223.30882.daniel.is.fisc...@web.de> Content-Type: text/plain; charset="utf-8" On Saturday 12 June 2010 22:09:48, bitur mail wrote: > Hello, > > This is a dumb question but ... > > I'm just starting with the book Real World Haskell, and in chapter 2 it > mentions that "Haskell doesn't have a notion of a one-element tuple". > > I am confused by this because I type, for example, (143), into the > interpreter and it does not complain. What does Haskell consider (143) > to be? An ordinary value, enclosed in parentheses. Prelude> :t (143) (143) :: (Num t) => t Prelude> (143) == 143 True That's different to e.g. Python: >>> x = (3,) >>> len(x) 1 >>> type(x) <type 'tuple'> >>> x == 3 False which has a notion of 1-tuples having a type different from the type of their components. > > Thanks :) > DG ------------------------------ Message: 5 Date: Sun, 13 Jun 2010 16:00:15 +1000 From: Erik de Castro Lopo <mle...@mega-nerd.com> Subject: [Haskell-beginners] hPutChar: invalid argument (Invalid or incomplete multibyte or wide character To: beginners@haskell.org Message-ID: <20100613160015.44aebdbe.mle...@mega-nerd.com> Content-Type: text/plain; charset=US-ASCII HI all, I've managed to use the Curl bindings to pull down a web page, and I'm using TagSoup to parse it, but when I try to print the text in a TagText I get hPutChar: invalid argument (Invalid or incomplete multibyte or wide character) The code looks like: parsePage :: String -> IO () parsePage page = do let tags = map deTag $ filter isTagText $ parseTags page mapM_ putStrLn tags where deTag (TagText s) = s deTag x = error $ "Bad Tag '" ++ show x ++ "' in deTag." This is with ghc-6.12.1 on Debian Linux. Any clues appreciated. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/ ------------------------------ Message: 6 Date: Sun, 13 Jun 2010 13:07:03 +0200 From: Daniel Fischer <daniel.is.fisc...@web.de> Subject: Re: [Haskell-beginners] hPutChar: invalid argument (Invalid or incomplete multibyte or wide character To: beginners@haskell.org Message-ID: <201006131307.04366.daniel.is.fisc...@web.de> Content-Type: text/plain; charset="iso-8859-1" On Sunday 13 June 2010 08:00:15, Erik de Castro Lopo wrote: > HI all, > > I've managed to use the Curl bindings to pull down a web page, and I'm > using TagSoup to parse it, but when I try to print the text in a TagText > I get > > hPutChar: invalid argument (Invalid or incomplete multibyte or wide > character) > > The code looks like: > > parsePage :: String -> IO () > parsePage page = do > let tags = map deTag $ filter isTagText $ parseTags page > mapM_ putStrLn tags > where > deTag (TagText s) = s > deTag x = error $ "Bad Tag '" ++ show x ++ "' in deTag." > > > This is with ghc-6.12.1 on Debian Linux. > > Any clues appreciated. > > Cheers, > Erik Probably the page you've tried it on wasn't encoded in your locale encoding. If the page was in latin1 and your locale is UTF-8, there will likely be invalid (for UTF-8) byte sequences in it. For a locally stored page, the code above worked fine with tagsoup-0.6 and tagsoup-0.10 when the page was utf-8-encoded, but if it was latin1-encoded (and contained non-ASCII chars), it raised an invalid argument (Invalid or incomplete multibyte or wide character) error (on hGetContents, though, I suppose that's because I used readFile and not th Curl-bindings). ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 24, Issue 12 *****************************************