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: Searching for word in 2D array (Ozgur Akgun) 2. Re: Searching for word in 2D array (Ozgur Akgun) 3. Re: Compiling GHC 7.4.1 on Mac OS X, XCode 4.3 (Jack Henahan) ---------------------------------------------------------------------- Message: 1 Date: Fri, 23 Mar 2012 15:41:36 +0000 From: Ozgur Akgun <ozgurak...@gmail.com> Subject: Re: [Haskell-beginners] Searching for word in 2D array To: Lorenzo Bolla <lbo...@gmail.com> Cc: beginners@haskell.org Message-ID: <calzazpbxgndmzjb3vxczkqyidclrjkku2nq+i4bn6wrew-h...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On 23 March 2012 10:06, Lorenzo Bolla <lbo...@gmail.com> wrote: > I'm not sure Data.Set would work, because afaik, Sets don't preserve > ordering: so a row like "abc" and "cab" would be represented by the same > Set. > What? Yes, Data.Set doesn't preserve any ordering between the members of it. It doesn't modify the members themselves and shuffle their content though. Try it for yourself: ghci> S.fromList ["abc", "cab"] ghci> S.fromList ["abc", "cab", "abc"] Ozgur -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120323/d5cc990a/attachment-0001.htm> ------------------------------ Message: 2 Date: Fri, 23 Mar 2012 15:45:59 +0000 From: Ozgur Akgun <ozgurak...@gmail.com> Subject: Re: [Haskell-beginners] Searching for word in 2D array To: Nathan H?sken <nathan.hues...@posteo.de> Cc: beginners@haskell.org Message-ID: <calzazpdhndzjgy0niuhru_d+jejyr2crpym_-e3lc5bwqym...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On 23 March 2012 10:01, Nathan H?sken <nathan.hues...@posteo.de> wrote: > If I understand correctly, in this solution it is assumed that that a > word must be a complete line (row column or diagonal), correct? > No it doesn't. See the "search" function and the use of isInfixOf there. > I do not understand why a set is used. Couldn't just a list be used > here, or is there some performance advantage I do not see? > You certainly can use a list in this case. However, if you do not care about the number of times a word appears in a collection (which seemed to be the case here), then using a Set might be a better idea. You can implement the same thing using lists instead of sets and see it for yourself :) > I find it very difficult to estimate the performance of an haskell > program. The other solution of Lorenzo Bolla utilizes Data.Vector. > Does that give a performance advantage in this case? I don't use a lot of Vectors, so no comment here. Cheers, Ozgur -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120323/ea399dc7/attachment-0001.htm> ------------------------------ Message: 3 Date: Fri, 23 Mar 2012 21:33:42 -0400 From: Jack Henahan <jhena...@uvm.edu> Subject: Re: [Haskell-beginners] Compiling GHC 7.4.1 on Mac OS X, XCode 4.3 To: Obscaenvs <obscae...@gmail.com> Cc: beginners@haskell.org Message-ID: <a0588e4e-9c53-46c0-91bf-615a0d488...@uvm.edu> Content-Type: text/plain; charset="us-ascii" You need to install the command-line tools from Xcode's preferences because the locations in the Developer prefix don't play nice. The package will install the usual tools to the usual locations, and all should be well. Jack Henahan jhena...@uvm.edu == Computer science is no more about computers than astronomy is about telescopes. -- Michael R. Fellows == -------------- next part -------------- A non-text attachment was scrubbed... Name: PublicKey.asc Type: application/x-apple-msg-attachment Size: 24255 bytes Desc: not available URL: <http://www.haskell.org/pipermail/beginners/attachments/20120323/7d8af1fb/attachment.bin> -------------- next part -------------- On Mar 5, 2012, at 7:08 AM, Obscaenvs <obscae...@gmail.com> wrote: > Hello! I have for various subtle reasons bought a MacBook Pro. It certainly > is very shiny :) > > I find it somewhat reluctant in the Haskell department, though: I do not want > the lagging haskell-platform, and decided to do things from scratch, i.e. > compile ghc myself. I followed the intructions, and I *have* compiled stuff > before, so I'm not completely lost. However, after ./configure, make exits > with the message > > <code> > ===--- building phase 0 > make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds > libraries/extensible-exceptions/ghc.mk:3: > libraries/extensible-exceptions/dist-boot/package-data.mk: No such file or > directory > libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/package-data.mk: No such file > or directory > libraries/Cabal/Cabal/ghc.mk:3: > libraries/Cabal/Cabal/dist-boot/package-data.mk: No such file or directory > libraries/binary/ghc.mk:3: libraries/binary/dist-boot/package-data.mk: No > such file or directory > libraries/bin-package-db/ghc.mk:3: > libraries/bin-package-db/dist-boot/package-data.mk: No such file or directory > libraries/hoopl/ghc.mk:3: libraries/hoopl/dist-boot/package-data.mk: No such > file or directory > compiler/ghc.mk:437: compiler/stage1/package-data.mk: No such file or > directory > utils/hsc2hs/ghc.mk:14: utils/hsc2hs/dist/package-data.mk: No such file or > directory > ghc/ghc.mk:93: ghc/stage1/package-data.mk: No such file or directory > "inplace/bin/ghc-cabal" configure --with-ghc="/usr/bin/ghc" > --with-ghc-pkg="/usr/bin/ghc-pkg" > --package-db=/Users/fcar/Downloads/ghc-7.4.1/libraries/bootstrapping.conf > --enable-library-profiling --enable-shared --enable-library-for-ghci > --configure-option=CFLAGS=" -m64 -fno-stack-protector " > --configure-option=LDFLAGS=" -m64 " --configure-option=CPPFLAGS=" -m64 " > --constraint "Cabal == 1.14.0" --constraint "hpc == 0.5.1.1" --constraint > "extensible-exceptions == 0.1.1.4" --constraint "binary == 0.5.1.0" > --constraint "bin-package-db == 0.0.0.0" --constraint "hoopl == 3.8.7.3" > --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc" > --with-ar="/Developer/usr/bin/ar" --with-ranlib="ranlib" -- dist-boot > libraries/Cabal/Cabal > Configuring Cabal-1.14.0... > ghc-cabal: Cannot find the program 'ar' at '/Developer/usr/bin/ar' or on the > path > make[1]: *** [libraries/Cabal/Cabal/dist-boot/package-data.mk] Error 1 > make: *** [all] Error 2 > </code> > > > I can clearly make out the offending flag: --with-ar="/Developer/usr/bin/ar". > Having Xcode 4.3, there is no longer any /Developer folder - but where do I > tell it to use "/usr/bin/ar" instead? Furthermore, it says "or on the > path" above, but /usr/bin *is* in PATH, at least in the environment I have at > the shell prompt (but this might be changed in some script that make calls or > whatever...) > > > Grateful for help. > > /Fredrik, Stockholm > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 45, Issue 30 *****************************************