Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.haskell.org/cgi-bin/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. cabal install zlib failing (John Ky) 2. Re: Help refactor monster function (D?niel Arat?) 3. Re: Help refactor monster function (Gesh) 4. Re: cabal install zlib failing (John Ky) ---------------------------------------------------------------------- Message: 1 Date: Sun, 24 Apr 2016 13:55:08 +0000 From: John Ky <newho...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <Beginners@haskell.org> Subject: [Haskell-beginners] cabal install zlib failing Message-ID: <camb4o-aucxn2kd7s23vp69xyby9jyjsmzzjn2zzhdyydqnc...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Hello Haskellers, Does anyone know what to do in this situation? cabal install zlib Resolving dependencies... Notice: installing into a sandbox located at /home/ubuntu/hw-files/.cabal-sandbox/7.10.3 Downloading zlib-0.6.1.1... Configuring zlib-0.6.1.1... Failed to install zlib-0.6.1.1 Build log ( /home/ubuntu/hw-files/.cabal-sandbox/7.10.3/logs/zlib-0.6.1.1.log ): Configuring zlib-0.6.1.1... setup-Simple-Cabal-1.22.5.0-x86_64-linux-ghc-7.10.3: Missing dependency on a foreign library: * Missing (or bad) header file: zlib.h * Missing C library: z This problem can usually be solved by installing the system package that provides this library (you may need the "-dev" version). If the library is already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where it is. If the header file does exist, it may contain errors that are caught by the C compiler at the preprocessing stage. In this case you can re-run configure with the verbosity flag -v3 to see the error messages. cabal: Error: some packages failed to install: zlib-0.6.1.1 failed during the configure step. The exception was: ExitFailure 1 This is what I have in my environment: ubuntu@box1179:~/hw-files$ dpkg -l | grep zlib ii zlib1g 1:1.2.3.4.dfsg-3ubuntu4 compression library - runtime ii zlib1g:i386 1:1.2.3.4.dfsg-3ubuntu4 compression library - runtime iU zlib1g-dev 1:1.2.8.dfsg-1ubuntu1 compression library - development And this: ubuntu@box1179:~/hw-files$ nix-env -q cabal-install-1.22.9.0 ghc-7.10.3 nix-1.11.2 zlib-1.2.8 Cheers, -John ? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160424/8e22c73b/attachment-0001.html> ------------------------------ Message: 2 Date: Sun, 24 Apr 2016 16:41:00 +0200 From: D?niel Arat? <exitcons...@gmail.com> To: beginners@haskell.org Subject: Re: [Haskell-beginners] Help refactor monster function Message-ID: <CAHvKd2KrpKME1jB7_5EDwHzKW5nOAefwugzPtem0LGH2teU=c...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 >> consume f g a = foldl f a . chunk g >> chunk g = unfoldr (fmap g . (\xs -> if null xs then Nothing else Just xs)) Wow, nice. I figured there must be a better way to express that. >> gatherRoots = chunk (partition (compare `on` root)) That doesn't typecheck. I think you meant > gatherRoots = chunk $ \ l@(x:_) -> partition (\y -> root x == root y) l > P.S. You would be correct in claiming that this rewrite is too distant from > the original to be of use. My apologies if this is the case. No, this helps a lot, thanks! Reading pro Haskell like this helps me improve. It's way more advanced than what I could possibly come up with though. I'm still working my way through it. Daniel ------------------------------ Message: 3 Date: Sun, 24 Apr 2016 20:38:37 +0300 From: Gesh <g...@gesh.uni.cx> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Help refactor monster function Message-ID: <f3857e8b-00ad-4815-a92b-63dc367a1...@gesh.uni.cx> Content-Type: text/plain; charset=UTF-8 On April 24, 2016 5:41:00 PM GMT+03:00, "D?niel Arat?" <exitcons...@gmail.com> wrote: >>> gatherRoots = chunk (partition (compare `on` root)) > >That doesn't typecheck. I think you meant >> gatherRoots = chunk $ \ l@(x:_) -> partition (\y -> root x == root y) >l > You are correct, that was an error in transcription. >> P.S. You would be correct in claiming that this rewrite is too >distant from >> the original to be of use. My apologies if this is the case. > >No, this helps a lot, thanks! Reading pro Haskell like this helps me >improve. It's way more advanced than what I could possibly come up >with though. I'm still working my way through it. I'm glad it helped. Gesh ------------------------------ Message: 4 Date: Mon, 25 Apr 2016 03:41:48 +0000 From: John Ky <newho...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <Beginners@haskell.org> Subject: Re: [Haskell-beginners] cabal install zlib failing Message-ID: <camb4o-b9b_hc4odcrtbda3cztbwowvmd7i-swns9be5k03r...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Hi Haskellers, I found that this works for me: nix-shell -p zlib --run 'cabal install zlib' Cheers, -John ? On Sun, 24 Apr 2016 at 23:55 John Ky <newho...@gmail.com> wrote: > Hello Haskellers, > > Does anyone know what to do in this situation? > > cabal install zlib > Resolving dependencies... > Notice: installing into a sandbox located at > /home/ubuntu/hw-files/.cabal-sandbox/7.10.3 > Downloading zlib-0.6.1.1... > Configuring zlib-0.6.1.1... > Failed to install zlib-0.6.1.1 > Build log ( /home/ubuntu/hw-files/.cabal-sandbox/7.10.3/logs/zlib-0.6.1.1.log > ): > Configuring zlib-0.6.1.1... > setup-Simple-Cabal-1.22.5.0-x86_64-linux-ghc-7.10.3: Missing dependency on a > foreign library: > * Missing (or bad) header file: zlib.h > * Missing C library: z > This problem can usually be solved by installing the system package that > provides this library (you may need the "-dev" version). If the library is > already installed but in a non-standard location then you can use the flags > --extra-include-dirs= and --extra-lib-dirs= to specify where it is. > If the header file does exist, it may contain errors that are caught by the C > compiler at the preprocessing stage. In this case you can re-run configure > with the verbosity flag -v3 to see the error messages. > cabal: Error: some packages failed to install: > zlib-0.6.1.1 failed during the configure step. The exception was: > ExitFailure 1 > > This is what I have in my environment: > > ubuntu@box1179:~/hw-files$ dpkg -l | grep zlib > ii zlib1g > 1:1.2.3.4.dfsg-3ubuntu4 compression library - > runtime > ii zlib1g:i386 > 1:1.2.3.4.dfsg-3ubuntu4 compression library - > runtime > iU zlib1g-dev > 1:1.2.8.dfsg-1ubuntu1 compression library - > development > > And this: > > ubuntu@box1179:~/hw-files$ nix-env -q > cabal-install-1.22.9.0 > ghc-7.10.3 > nix-1.11.2 > zlib-1.2.8 > > Cheers, > > -John > ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160425/a5b2a3bd/attachment.html> ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 94, Issue 25 *****************************************