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. lazy IO by example (Tim Baumgartner) 2. Re: gtk2hs [GIMP ToolKit] (Tim Baumgartner) 3. Re: gtk2hs [GIMP ToolKit] (Patrick Lynch) 4. Re: gtk2hs [GIMP ToolKit] (Patrick Lynch) ---------------------------------------------------------------------- Message: 1 Date: Fri, 4 Feb 2011 13:29:49 +0100 From: Tim Baumgartner <baumgartner....@googlemail.com> Subject: [Haskell-beginners] lazy IO by example To: beginners@haskell.org Message-ID: <aanlktiny2r1pvqh4dr9tc7v-avjccvnuz4gwevj6a...@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Hi community, In the following code, the main function only wants to print the first 5 numbers of a huge list. But since the computation is not lazy, this doesn't work in a satisfactory way. content :: Int -> IO [Int] content i = do fs <- files i ds <- directories i fss <- mapM content ds return $ fs ++ concat fss files i = return [1..i] directories i = return [1..i-1] main = content 1000000 >>= print . take 5 Now I'd like to know if it's possible to make this "IO" lazy, using unsafeInterleaveIO. I tried to do it, failed. Perhaps someone can help. I guess another weakness of this code is the bad performance of "dfs ++ concat fss", but currently I don't care about that. Thanks for any help Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20110204/4d81ea72/attachment-0001.htm> ------------------------------ Message: 2 Date: Fri, 4 Feb 2011 20:13:56 +0100 From: Tim Baumgartner <baumgartner....@googlemail.com> Subject: Re: [Haskell-beginners] gtk2hs [GIMP ToolKit] To: beginners@haskell.org Message-ID: <AANLkTin++Ps8tkF42K=b-epas6rins56jvp0dq_1r...@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Hi Patrick, I used the same link to install gtk2hs on Windows XP with Haskell Platform 2010.2.0 about 3 days ago. I'm a beginner as well. I had a number of problems. In the end, I managed to install version 0.11 with some extra-work: - I added HaskellPlatform/2010.2.0.0/mingw/bin to the PATH (because there is my only current gcc.exe) - ugly: I copied Gtk+/include/glib-2.0 to a temp folder and copied this again *into* Gtk+/include/glib-2.0 (the output of pkg-config looked alright...) - I repeated the previous steps for other include folders as well Note: in order to install a specific version of a package you can e.g. cabal install gtk2hs-buildtools-0.11.2 Installation of 0.12. failed with the following error: [ 5 of 24] Compiling System.GIO.Volumes.VolumeMonitor ( dist\build\System\GIO\Volumes\VolumeMonitor.hs, dist\build\System\GIO\Volumes\VolumeMonitor.o ) System\GIO\Volumes\VolumeMonitor.chs:56:4: Not in scope: `vmDriveStopButton' Regards, Tim 2011/2/3 Patrick Lynch <kmandpjly...@verizon.net> > ...I'm going to try to install gtk2hs again... > ...I'll be using the link http://www.haskell.org/haskellwiki/Gtk2Hs > ...I'd appreciate any help... > > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20110204/b92819cd/attachment-0001.htm> ------------------------------ Message: 3 Date: Fri, 04 Feb 2011 14:23:47 -0500 From: "Patrick Lynch" <kmandpjly...@verizon.net> Subject: Re: [Haskell-beginners] gtk2hs [GIMP ToolKit] To: "Tim Baumgartner" <baumgartner....@googlemail.com>, <beginners@haskell.org> Message-ID: <617561482BAB4DB5AEA8AD169446C0A2@UserPC> Content-Type: text/plain; charset="iso-8859-1" Good moring, ...I know how hard it is... ...this will be my second attempt on a Windows Vista PC...I also have to install it on a Mac... ...I'll try it again this afternoon... Good luck to both of us It really shouldn't be this hard...bummer... ----- Original Message ----- From: Tim Baumgartner To: beginners@haskell.org Cc: Patrick Lynch Sent: Friday, February 04, 2011 2:13 PM Subject: Re: [Haskell-beginners] gtk2hs [GIMP ToolKit] Hi Patrick, I used the same link to install gtk2hs on Windows XP with Haskell Platform 2010.2.0 about 3 days ago. I'm a beginner as well. I had a number of problems. In the end, I managed to install version 0.11 with some extra-work: - I added HaskellPlatform/2010.2.0.0/mingw/bin to the PATH (because there is my only current gcc.exe) - ugly: I copied Gtk+/include/glib-2.0 to a temp folder and copied this again *into* Gtk+/include/glib-2.0 (the output of pkg-config looked alright...) - I repeated the previous steps for other include folders as well Note: in order to install a specific version of a package you can e.g. cabal install gtk2hs-buildtools-0.11.2 Installation of 0.12. failed with the following error: [ 5 of 24] Compiling System.GIO.Volumes.VolumeMonitor ( dist\build\System\GIO\Volumes\VolumeMonitor.hs, dist\build\System\GIO\Volumes\VolumeMonitor.o ) System\GIO\Volumes\VolumeMonitor.chs:56:4: Not in scope: `vmDriveStopButton' Regards, Tim 2011/2/3 Patrick Lynch <kmandpjly...@verizon.net> ...I'm going to try to install gtk2hs again... ...I'll be using the link http://www.haskell.org/haskellwiki/Gtk2Hs ...I'd appreciate any help... _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20110204/f659d259/attachment-0001.htm> ------------------------------ Message: 4 Date: Fri, 04 Feb 2011 18:01:34 -0500 From: "Patrick Lynch" <kmandpjly...@verizon.net> Subject: Re: [Haskell-beginners] gtk2hs [GIMP ToolKit] To: "Tim Baumgartner" <baumgartner....@googlemail.com>, <beginners@haskell.org> Message-ID: <8390151C5E96413981B88847C61DA29F@UserPC> Content-Type: text/plain; charset="iso-8859-1" ...i'm running into the same problem... ...i ran the command: cabal install gtk... ...it can't find the folders: Z, CAIRO, GOBJECT-2.0, GLIB-2.0, INTL. ...however, they are all, with the exception of Z and possibly GOBJECT-2.0 - there is no folder for this but there is a library file for it, in Program Files and surprisingly also in Program Files (X86)... ...i'm a bit confused about my %PATH% setting, it is different in the Advanced system settings from what is displayed by echo %PATH% in the Command window - see following... C:\Users\User>cabal install gtk Resolving dependencies... C:\Users\User\AppData\Local\Temp\cairo-0.12.02164\cairo-0.12.0\Gtk2HsSetup.hs:25: warning: #warning Setup.hs is guessing the version of Cabal. If compilation of Se tup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when building (prefixed by --ghc-option= when using the 'cabal' command) [1 of 2] Compiling Gtk2HsSetup ( C:\Users\User\AppData\Local\Temp\cairo-0.12.02164\cairo-0.12.0\Gtk2HsSetup.hs, C:\Users\User\AppData\Local\Temp\cairo-0.12.02 164\cairo-0.12.0\dist\setup\Gtk2HsSetup.o ) [2 of 2] Compiling Main ( C:\Users\User\AppData\Local\Temp\cairo-0.12.02164\cairo-0.12.0\Setup.hs, C:\Users\User\AppData\Local\Temp\cairo-0.12.02164\ca iro-0.12.0\dist\setup\Main.o ) Linking C:\Users\User\AppData\Local\Temp\cairo-0.12.02164\cairo-0.12.0\dist\setup\setup.exe ... Configuring cairo-0.12.0... setup.exe: Missing dependencies on foreign libraries: * Missing C libraries: z, cairo This problem can usually be solved by installing the system packages that provide these libraries (you may need the "-dev" versions). If the libraries are already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are. C:\Users\User\AppData\Local\Temp\glib-0.12.02164\glib-0.12.0\Gtk2HsSetup.hs:25: warning: #warning Setup.hs is guessing the version of Cabal. If compilation of Setu p.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when building (prefixed by --ghc-option= when using the 'cabal' command) [1 of 2] Compiling Gtk2HsSetup ( C:\Users\User\AppData\Local\Temp\glib-0.12.02164\glib-0.12.0\Gtk2HsSetup.hs, C:\Users\User\AppData\Local\Temp\glib-0.12.02164 \glib-0.12.0\dist\setup\Gtk2HsSetup.o ) [2 of 2] Compiling Main ( C:\Users\User\AppData\Local\Temp\glib-0.12.02164\glib-0.12.0\Setup.hs, C:\Users\User\AppData\Local\Temp\glib-0.12.02164\glib- 0.12.0\dist\setup\Main.o ) Linking C:\Users\User\AppData\Local\Temp\glib-0.12.02164\glib-0.12.0\dist\setup\setup.exe ... Configuring glib-0.12.0... setup.exe: Missing dependencies on foreign libraries: * Missing C libraries: gobject-2.0, glib-2.0, intl This problem can usually be solved by installing the system packages that provide these libraries (you may need the "-dev" versions). If the libraries are already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are. cabal: Error: some packages failed to install: cairo-0.12.0 failed during the configure step. The exception was: ExitFailure 1 gio-0.12.0 depends on glib-0.12.0 which failed to install. glib-0.12.0 failed during the configure step. The exception was: ExitFailure 1 gtk-0.12.0 depends on glib-0.12.0 which failed to install. pango-0.12.0 depends on glib-0.12.0 which failed to install. C:\Users\User> --------------------------------------------------------------------------- --My %PATH% at the command window C:\Program Files (x86)\Haskell\bin; C:\Program Files (x86)\Haskell Platform\2010.2.0.0\lib\extralibs\bin; C:\Program Files (x86)\Haskell Platform\2010.2.0.0\bin; C:\Windows\system32; C:\Windows;C:\Windows\System32\Wbem; C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\; C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\; C:\Users\User\AppData\Roaming\cabal\bin;C:\Program Files\Gtk+\bin; C:\Users\User;C:\Program Files (x86)\Gtk+\bin; c:\Program Files (x86)\Gtk+\share\gettext --My %PATH% at the Advanced system settings C:\Users\User\AppData\Roaming\cabal\bin; C:\Program Files\Gtk+\bin; C:\Users\User; C:\Program Files (x86)\Gtk+\bin; c:\Program Files (x86)\Gtk+\share\gettext ---------------------------------------------------------------------------- .To the PKG_CONFIG_PATH environment variable add the 'pkgconfig' directory. The default path should be " C:\Program Files\Gtk+\lib\pkgconfig .To the INCLUDE environment variable add the 'libglade-2.0' directory.The default path should be " C:\Program Files\Gtk+\include\libglade-2.0 C:\Program Files\Gtk+\lib\pkgconfig; C:\Program Files\Gtk+\lib\pkgconfig\include; c:\users\user\downloads\libxml2-2.2.7-1_win32\lib\pkgconfig ...i'll have to try what you did to see if i can get it installed... Good weekend ----- Original Message ----- From: Tim Baumgartner To: beginners@haskell.org Cc: Patrick Lynch Sent: Friday, February 04, 2011 2:13 PM Subject: Re: [Haskell-beginners] gtk2hs [GIMP ToolKit] Hi Patrick, I used the same link to install gtk2hs on Windows XP with Haskell Platform 2010.2.0 about 3 days ago. I'm a beginner as well. I had a number of problems. In the end, I managed to install version 0.11 with some extra-work: - I added HaskellPlatform/2010.2.0.0/mingw/bin to the PATH (because there is my only current gcc.exe) - ugly: I copied Gtk+/include/glib-2.0 to a temp folder and copied this again *into* Gtk+/include/glib-2.0 (the output of pkg-config looked alright...) - I repeated the previous steps for other include folders as well Note: in order to install a specific version of a package you can e.g. cabal install gtk2hs-buildtools-0.11.2 Installation of 0.12. failed with the following error: [ 5 of 24] Compiling System.GIO.Volumes.VolumeMonitor ( dist\build\System\GIO\Volumes\VolumeMonitor.hs, dist\build\System\GIO\Volumes\VolumeMonitor.o ) System\GIO\Volumes\VolumeMonitor.chs:56:4: Not in scope: `vmDriveStopButton' Regards, Tim 2011/2/3 Patrick Lynch <kmandpjly...@verizon.net> ...I'm going to try to install gtk2hs again... ...I'll be using the link http://www.haskell.org/haskellwiki/Gtk2Hs ...I'd appreciate any help... _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20110204/9b9eab44/attachment.htm> ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 32, Issue 12 *****************************************