Re: [Haskell-cafe] [Haskell] ANNOUNCE: time-recurrence-0.1
Moving the discussion from haskell to haskell-cafe. Chris Heller wrote: http://github.com/hellertime/time-recurrence A library for generating and inspecting recurring times. Very nice. Please put it up on hackage so we can see the haddocks, try it out easily, etc. hoping to solicit some feedback on its design. Very well done. I have been think about recurrence rules, too. Version 2 Olson timezone files contain POSIX rules to specify clock change rules for times later than the last one listed in the timezone series. Currently, the timezone-series package ignores those. I like your introduction of symbolic months and weekdays. The numeric-only interface of Data.Time for those things leads to messiness like multiple functions depending on how you number the weekdays. That logic should be moved out to a separate interface. You are correct that it is worth creating a separate module for that. Please do so! Include neater versions of the corresponding functions from Data.Time. Another comment - I would have used fromGregorianValid instead of fromGregorian. It's not a good idea for a basic time library to introduce possible crashes. At least you should provide an alternative safe interface. Similarly for toEnum. The general direction is to have something that works much like the RRULE portion of the iCalendar (RFC 5545) specification. I have decided avoid strict RFC compliance at this time. Ashley Yakeley wrote: At one point I investigated a really generalised version of this, including an abstract syntax type and perhaps a way of parsing some useful subset of English expressions into it. However I got stuck on such things as any day after the sixth Sunday of a month In order to prove that today was not such a day, it would have know that sixth Sunday of a month never happens. Simply searching into the past for one would never terminate. Either I would have to restrict the language, or assert the beginning of time (not necessarily a bad solution). I don't see why you would need to make any such restrictions. There would only be a finite number of primitive comparison types, and since your language would be total, any expression could be reduced to the primitive ones in a finite number of steps. Then it would just be a matter of arithmetic on sets of ranges; see, for example, http://hackage.haskell.org/package/Ranged-sets That allows for half-infinite and infinite ranges as well. Regards, Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] SIGSEGV in yieldCapability ()
On Sun, May 22, 2011 at 15:03, Johannes Waldmann waldm...@imn.htwk-leipzig.de wrote: I think you should file a bug report with a test case on GHC. I am willing to work on this, but I thought I'd go fishing for some advice first. My program uses: forkIO, STM, and FFI. I've seen something like this, using only forkIO, so I'd start looking there. I was trying to create a reduced test case, but haven't reported a bug yet. I think that heap exhausted sometimes gets reported as evacuate: strange closure, (cf. http://hackage.haskell.org/trac/ghc/ticket/5085 ) and yieldCapability() might be another instance. Thank you, we just had this message, and I had no idea what it was. Erik ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Handling a large database (of ngrams)
On 5/22/11 8:40 AM, Aleksandar Dimitrov wrote: If you have too much trouble trying to get SRILM to work, there's also the Berkeley LM which is easier to install. I'm not familiar with its inner workings, but it should offer pretty much the same sorts of operations. Do you know how BerkeleyLM compares to, say MongoDB and PostgresQL for large data sets? Maybe this is also the wrong list to ask for this kind of question. Well, BerlekelyLM is specifically for n-gram language modeling, it's not a general database. According to the paper I mentioned off-list, the entire Google Web1T corpus (approx 1 trillion word tokens, 4 billion n-gram types) can be fit into 10GB of memory, which is much smaller than SRILM can do. Databases aren't really my area so I couldn't give a good comparison. Though for this scale of data you're going to want to use something specialized for storing n-grams, rather than a general database. There's a lot of redundant structure in n-gram counts and you'll want to take advantage of that. For regular projects, that integerization would be enough, but for your task you'll probably want to spend some time tweaking the codes. In particular, you'll probably have enough word types to overflow the space of Int32/Word32 or even Int64/Word64. Again according to Pauls Klein (2011), Google Web1T has 13.5M word types, which easily fits into 24-bits. That's for English, so morphologically rich languages will be different. I wouldn't expect too many problems for German, unless you have a lot of technical text with a prodigious number of unique compound nouns. Even then I'd be surprised if you went over 2^64 (that'd be reserved for languages like Japanese, Hungarian, Inuit,... if even they'd ever get that bad). -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
[TL;DR: there's a concrete question at the bottom.] Once again I find myself in the pleasant situation where the slings and arrows of life in general are slightly less intense, and I manage to find a few spare minutes and some free brain cycles to dedicate to Haskell. Why not try GHC 7.0.3? (after all, GHC 7 has been out for a good few months, so the teething troubles should have passed by now), and there's a lovely new Haskell Platform 2011.2.0.1 to go with it, so, maybe this time, I'll actually be able to use some of the libraries that I tried and failed to install during my last period of Haskell study. The two computers I have available for playing with Haskell run OS X Leopard (10.5), and Ubuntu Natty (11.04). First up OS X: It seems that GHC 7 (and consequently Platform 2011.2) require OS X 10.6. OK, let's forget that one. Next up: Ubuntu. There's a Linux Link on the Haskell Platform Page. Ooooh, there's an Ubuntu link. Ooooh! there's even a package for Natty, great! Version 2010.1.0.0.1 WTF? Where's the 2011.2 package? There isn't one. OOoooK. Any workarounds. Well, we can install from source, apparently. But we need GHC 7.0.3 first. Fine. Done. Now let's install the platorm. [Does obvious thing, compilation fails.] Hmm, let's follow the Complete instructions for installing from source http://www.vex.net/~trebla/haskell/haskell-platform.xhtml just in case I did something stupid. [Follows instructions: failure.] OK, maybe something somewhere is causing some confusion with previously installed versions of GHC, Cabal, whatever. [Performs Haskell pogrom on system: removes all traces of anything Haskell related. Follows Complete instructions [...] WORD ... FOR ... WORD. Failure]. Aaaargh ! I can't take it any more. I just want to write some Haskell, and every time I want to venture beyond the safe confines of the Prelude I get bogged down in installation hell. Next time I have some spare time, I will be more reluctant to risk having that time stolen by the Haskell infrastructure installation process. So, after this tale of agony, here are two concrete questions: a) Am I right in concluding that GHC 7.0.3 will not run on OS X 10.5 (without unreasonable effort)? b) On Ubuntu Natty I installed the generic linux GHC 7.0.3 binary. Downloaded Haskell Platform 2011.2.0.1 source distribution. ./ configure worked happily. make fails as follows. Building transformers-0.2.2.0 /usr/local/haskell-platform-2011.2.0.1/bin/ghc --make Setup -o Setup -package Cabal-1.10.1.0 command line: cannot satisfy -package Cabal-1.10.1.0: Cabal-1.10.1.0-1fb2094e19492373b1a39284193e7984 is unusable due to missing or recursive dependencies: process-1.0.1.5-55dfaccf3a91c4cb8f6284a0bafef198 Could anybody help me get past this problem? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics
Message: 17 Date: Fri, 20 May 2011 15:59:51 -0700 From: Evan Laforge qdun...@gmail.com Subject: Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics To: Erik Hesselink hessel...@gmail.com Cc: haskell-cafe@haskell.org Message-ID: BANLkTi=74mm6ortu2e192jtoot9g49f...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 Note that it is supposed to be possible to build gtk2hs with gtk+osx, which will not use X11 but use the native OS X GUI. I've not been able to get this to work, but it's been a while since I tried. The Haskell wiki mentions it doesn't support Glade, but does support Cairo. If this were to work, gtk2hs would be a serious option as well. I've tried this 3 or 4 times, and failed every time. It's crazy complicated. I used to use this combination regularly. IME the difficulties are primarily with getting a working gtk+osx build. Once that was accomplished, gtk2hs was a straightforward install, provided you build from the src repo with the -quartz flag. Recently I've switched to using macports gtk2 with the quartz, no-x11 variant, which also uses native cocoa. This is much more reliable than gtk+osx. I don't know if it supports Glade though. My biggest problem with wx is that there's no support for building 64-bit wx applications on OS X. If that were fixed I might prefer it. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Building Haskell Platform natively for 64bit Windows
On 18/05/2011 19:22, Jason Dagit wrote: On Wed, May 18, 2011 at 2:50 AM, John Sneerjohnsn...@operamail.com wrote: Hello all, I know it is not probably good question to this list, but anyway, could anyone point me to some more detailed how to where is described building of Haskell Platform natively to 64bit Windows? If you figure out how to do this, I would like to know as well. I could also benefit from 64bit Haskell on windows. There is no port of GHC to 64-bit Windows yet. Various people have expressed an interest in having one, but it is a significant chunk of work to implement (plus extra work to maintain and build distributions), so we don't have any plans to do it in the short term. You can track progress (or lack thereof) by adding your email to the CC on the ticket: http://hackage.haskell.org/trac/ghc/ticket/1884 If you want to help out, join cvs-...@haskell.org and we can help with pointers to what needs to be done. Cheers, Simon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On Mon, May 23, 2011 at 5:17 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: So, after this tale of agony, here are two concrete questions: a) Am I right in concluding that GHC 7.0.3 will not run on OS X 10.5 (without unreasonable effort)? This is a frustrating situation. Note that there is a binary for 7.0.1 that supports 10.5 http://www.haskell.org/ghc/download_ghc_7_0_1#macosxintel. From this, you should be able to build 7.0.3 yourself. One minor note: if you're interested in LLVM, stick to the 32-bit build.! If you encounter problems, #haskell will help. As for the platform, if it is giving you trouble, don't shy away from just using GHC and cabal as normal! After you've cabal installed a few big packages, you will find that you've acquired many of the most popular packages. b) On Ubuntu Natty I installed the generic linux GHC 7.0.3 binary. Downloaded Haskell Platform 2011.2.0.1 source distribution. ./configure worked happily. make fails as follows. Building transformers-0.2.2.0 /usr/local/haskell-platform-2011.2.0.1/bin/ghc --make Setup -o Setup -package Cabal-1.10.1.0 command line: cannot satisfy -package Cabal-1.10.1.0: Cabal-1.10.1.0-1fb2094e19492373b1a39284193e7984 is unusable due to missing or recursive dependencies: process-1.0.1.5-55dfaccf3a91c4cb8f6284a0bafef198 The Ubuntu HP story is a bit of a gotcha for the innocent user, too. But, again, you can happily install GHC 7.0.3, and then cabal install your way to happiness. The problem you encountered seems due to a conflict among packages that came with GHC. I think your strategy of nuking everything Haskell through your package manager (if available), then manually (not forgetting ~/.ghc and ~/.cabal) was prudent to get out of the hole you found yourself in. But don't let HP installation troubles keep you away from Haskell altogether! Anthony ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On 2011 May 23, at 13:45, Anthony Cowley wrote: On Mon, May 23, 2011 at 5:17 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: a) Am I right in concluding that GHC 7.0.3 will not run on OS X 10.5 (without unreasonable effort)? This is a frustrating situation. Note that there is a binary for 7.0.1 that supports 10.5 http://www.haskell.org/ghc/download_ghc_7_0_1#macosxintel. OK, that was painless. Thanks! From this, you should be able to build 7.0.3 yourself. That's interesting. I won't try that *right* now. As for the platform, if it is giving you trouble, don't shy away from just using GHC and cabal as normal! After you've cabal installed a few big packages, you will find that you've acquired many of the most popular packages. If by cabal install you mean use the command cabal ... yeah, that would be great, if only I could install cabal-install, which fails. Or do you mean manual install of Cabal packages? Either way, I'm not making much progress. b) On Ubuntu Natty I installed the generic linux GHC 7.0.3 binary. Downloaded Haskell Platform 2011.2.0.1 source distribution. ./ configure worked happily. make fails as follows. Building transformers-0.2.2.0 /usr/local/haskell-platform-2011.2.0.1/bin/ghc --make Setup - o Setup -package Cabal-1.10.1.0 command line: cannot satisfy -package Cabal-1.10.1.0: Cabal-1.10.1.0-1fb2094e19492373b1a39284193e7984 is unusable due to missing or recursive dependencies: process-1.0.1.5-55dfaccf3a91c4cb8f6284a0bafef198 The Ubuntu HP story is a bit of a gotcha for the innocent user, too. But, again, you can happily install GHC 7.0.3, and then cabal install your way to happiness. Maybe if I managed to install just one package manually, then I might start sharing some of you optimism :-) The problem you encountered seems due to a conflict among packages that came with GHC. Which does seem rather odd, doesn't it? I'm tempted to think that I didn't quite manage to nuke everything, because I find it hard to believe that GHC itself comes with internal conflicts which The Google seems not to have heard about. I think your strategy of nuking everything Haskell through your package manager (if available), then manually (not forgetting ~/.ghc and ~/.cabal) was prudent to get out of the hole you found yourself in. Yup, ~/.ghc and ~/.cabal didn't escape my attention. Except that it doesn't seem to have worked (yet - hope springs eternal). When I ghc-pkg check, I get lots of complaints about ~/.cabal/lib/ somelibrary/ghc-7.0.3 not being found. Erm, I nuked it all and then installed ghc-7.0.3 from scratch (generic Linux binary package), so I've no idea *why* my system thinks that these should exist unless *it* put them there after the purge during the installation of ghc. Any ideas how to solve this? But don't let HP installation troubles keep you away from Haskell altogether! I'm determined not to let that happen, but when the few precious moments I can afford to spend on Haskell end up being spent on installation troubles rather than Haskell itself, then it does become rather tough to keep the motivation. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On Mon, May 23, 2011 at 8:16 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: On 2011 May 23, at 13:45, Anthony Cowley wrote: As for the platform, if it is giving you trouble, don't shy away from just using GHC and cabal as normal! After you've cabal installed a few big packages, you will find that you've acquired many of the most popular packages. If by cabal install you mean use the command cabal ... yeah, that would be great, if only I could install cabal-install, which fails. Or do you mean manual install of Cabal packages? Either way, I'm not making much progress. What I do is get GHC installed, then download the cabal-install package from hackage and use the bootstrap.sh installer it comes with. Then you can use the cabal executable to install packages as you go. Anthony ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On 2011 May 23, at 14:29, Anthony Cowley wrote: On Mon, May 23, 2011 at 8:16 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: On 2011 May 23, at 13:45, Anthony Cowley wrote: As for the platform, if it is giving you trouble, don't shy away from just using GHC and cabal as normal! After you've cabal installed a few big packages, you will find that you've acquired many of the most popular packages. If by cabal install you mean use the command cabal ... yeah, that would be great, if only I could install cabal-install, which fails. Or do you mean manual install of Cabal packages? Either way, I'm not making much progress. What I do is get GHC installed, then download the cabal-install package from hackage and use the bootstrap.sh installer it comes with. Then you can use the cabal executable to install packages as you go. Been there, done that, got the crashes :-( I've had the pleasure of watching the bootstrap.sh crash a number of times now. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On 2011 May 23, at 14:16, Jacek Generowicz wrote: On 2011 May 23, at 13:45, Anthony Cowley wrote: On Mon, May 23, 2011 at 5:17 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: I think your strategy of nuking everything Haskell through your package manager (if available), then manually (not forgetting ~/.ghc and ~/.cabal) was prudent to get out of the hole you found yourself in. Yup, ~/.ghc and ~/.cabal didn't escape my attention. Hmm, maybe I was mistaken, and maybe ~/.ghc survived. I nuked everything again (there was a .ghc: I assumed it had been re-created, but maybe it was an old one (I didn't check the datestamps), but no .cabal). Now 'make' and 'make install' *have* worked for HP. Haven't got around to trying to use it yet, but I thought I'd share the good news. Thanks for your moral support, it seems to have done the trick :-) Conclusion: I *probably* failed to remove ~/.ghc, so some old data were interfering with the supposedly clean installation. A manual install of the GHC 7.0.3 generic Linux binary, followed by installation from source of HP 2011.2.0.1 *has* worked for me on Ubuntu Natty, once I nuked *all* previous traces of Haksell on the system. I *did* have to install libgmp in order for the configuration step of HP to succeed. Thanks for your help. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On Monday 23 May 2011 14:16:43, Jacek Generowicz wrote: From this, you should be able to build 7.0.3 yourself. That's interesting. I won't try that *right* now. It's easy, assuming you have installed alex and happy (and preferably hscolour), just download and unpack the source bundle, $ ./configure --prefix=wherever If it says it's going to build pdf and ps docs, that may fail if you have the wrong version of dblatex. $ make make install Go play a football match or something, that takes a while. As for the platform, if it is giving you trouble, don't shy away from just using GHC and cabal as normal! After you've cabal installed a few big packages, you will find that you've acquired many of the most popular packages. If by cabal install you mean use the command cabal ... yeah, that would be great, if only I could install cabal-install, which fails. With what error? Downloading and unpacking the .tar.gz bundle and then running $ ./bootstrap.sh in that directory should work. Or do you mean manual install of Cabal packages? That's not very comfortable, since you have to chase dependencies manually. Spending some effort to get cabal-install installed is definitely worth it. Yup, ~/.ghc and ~/.cabal didn't escape my attention. Except that it doesn't seem to have worked (yet - hope springs eternal). When I ghc-pkg check, I get lots of complaints about ~/.cabal/lib/ somelibrary/ghc-7.0.3 not being found. Erm, I nuked it all and then installed ghc-7.0.3 from scratch (generic Linux binary package), so I've no idea *why* my system thinks that these should exist unless *it* put them there after the purge during the installation of ghc. Any ideas how to solve this? Probably some package.conf.d survived the purge and was picked up by the fresh ghc. If you've deleted ~/.ghc, that would be in /usr/xxx. If you dare not messing around there, you could install ghc under $HOME, that shouldn't pick it up then. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
From: Jacek Generowicz jacek.generow...@cern.ch Sent: Monday, May 23, 2011 4:17 AM [TL;DR: there's a concrete question at the bottom.] Once again I find myself in the pleasant situation where the slings and arrows of life in general are slightly less intense, and I manage to find a few spare minutes and some free brain cycles to dedicate to Haskell. Why not try GHC 7.0.3? (after all, GHC 7 has been out for a good few months, so the teething troubles should have passed by now), and there's a lovely new Haskell Platform 2011.2.0.1 to go with it, so, maybe this time, I'll actually be able to use some of the libraries that I tried and failed to install during my last period of Haskell study. The two computers I have available for playing with Haskell run OS X Leopard (10.5), and Ubuntu Natty (11.04). I can't say anything about OS X, but I've been using ghc 7.0.3 under Ubuntu. I just cabal-install what I want - and use apt-get for any required C libraries. To set up cabal-install, the bootstrap.sh script which should come in the package is helpful - it automatically downloads the required dependencies. http://hackage.haskell.org/trac/hackage/wiki/CabalInstall Next up: Ubuntu. There's a Linux Link on the Haskell Platform Page. Ooooh, there's an Ubuntu link. Ooooh! there's even a package for Natty, great! Version 2010.1.0.0.1 WTF? Where's the 2011.2 package? There isn't one. I see there is a 2011.2 package for the next version, but it's probably too much trouble to fix up the other dependencies. b) On Ubuntu Natty I installed the generic linux GHC 7.0.3 binary. Downloaded Haskell Platform 2011.2.0.1 source distribution. ./configure worked happily. make fails as follows. Building transformers-0.2.2.0 /usr/local/haskell-platform-2011.2.0.1/bin/ghc --make Setup -o Setup -package Cabal-1.10.1.0 command line: cannot satisfy -package Cabal-1.10.1.0: Cabal-1.10.1.0-1fb2094e19492373b1a39284193e7984 is unusable due to missing or recursive dependencies: process-1.0.1.5-55dfaccf3a91c4cb8f6284a0bafef198 That's odd. I think 7.0.3 comes with Cabal-1.10.1.0. Here's my global package database: /usr/local/lib/ghc-7.0.3/package.conf.d Cabal-1.10.1.0 array-0.3.0.2 base-4.3.1.0 bin-package-db-0.0.0.0 bytestring-0.9.1.10 containers-0.4.0.0 directory-1.1.0.0 extensible-exceptions-0.1.1.2 ffi-1.0 filepath-1.2.0.0 ghc-7.0.3 ghc-binary-0.5.0.2 ghc-prim-0.2.0.0 haskell2010-1.0.0.0 haskell98-1.1.0.1 hpc-0.5.0.6 integer-gmp-0.2.0.3 old-locale-1.0.0.2 old-time-1.0.0.6 pretty-1.0.1.2 process-1.0.1.5 random-1.0.0.3 rts-1.0 template-haskell-2.5.0.0 time-1.2.0.3 unix-2.4.2.0 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On 2011 May 23, at 14:42, Daniel Fischer wrote: On Monday 23 May 2011 14:16:43, Jacek Generowicz wrote: If by cabal install you mean use the command cabal ... yeah, that would be great, if only I could install cabal-install, which fails. With what error? Downloading and unpacking the .tar.gz bundle and then running $ ./bootstrap.sh in that directory should work. Below is what I get *now* having just successfully installed a fresh GHC 7.0.3 and HP 2011.2.0.1. By successfully installed I mean that configure, make and make install didn't throw up any errors. I haven't tested that anything works yet. $ ./bootstrap.sh Checking installed packages for ghc-7.0.3... parsec-2.1.0.1 will be downloaded and installed. network is already installed and the version is ok. Cabal-1.8.0.2 will be downloaded and installed. mtl-1.1.0.2 will be downloaded and installed. HTTP-4000.0.8 will be downloaded and installed. zlib is already installed and the version is ok. Downloading parsec-2.1.0.1... ... Downloading Cabal-1.8.0.2... ... [56 of 58] Compiling Distribution.Simple.UserHooks ( Distribution/ Simple/UserHooks.hs, Distribution/Simple/UserHooks.o ) [57 of 58] Compiling Distribution.Simple ( Distribution/Simple.hs, Distribution/Simple.o ) [58 of 58] Compiling Main ( Setup.hs, Setup.o ) Linking Setup ... Configuring Cabal-1.8.0.2... Setup: At least the following dependencies are missing: base =4 3 =1 5, filepath =1 1.2 Error during cabal-install bootstrap: Configuring the Cabal package failed Or do you mean manual install of Cabal packages? That's not very comfortable, since you have to chase dependencies manually. Spending some effort to get cabal-install installed is definitely worth it. My thoughts exactly. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The Lisp Curse
On Thu, 19 May 2011, Andrew Coppin wrote: To all the people who look at Hackage, see that there are 6 different libraries for processing Unicode text files, and claim that this is somehow a *good* thing, I offer the above essay as a counter-example. Recently I searched for an advanced way of handling command-line arguments, and found several packages on Hackage. Unfortunately they are all in different categories, what makes the categories almost useless. The second thing I checked, is the online Haddock documentation in order to see, whether the API makes sense to me. I like to know, how many extensions are required (I prefer Haskell 98) and how clean the package is written, e.g. I think that something simple as command-line parsing should be possible without an unsafe function. In the end I found none of the packages to fit my needs and I stuck to plain GetOpt. Package ratings by certain criterias or by user votes would not help me much. Instead I like to get the information quickly, that helps me deciding, what package fits my needs best. E.g. Hackage could display the extensions used by a package, but it cannot just list the ones listed in the Cabal file, since modules can switch on extensions individually and also the extensions required by imported packages are needed. Maybe Hackage could allow to list or even rank packages according to criteria given by the user. In contrast to that, universal ratings would not help me much, but may frustrate authors, who's packages get bad ratings, because the expectations of its users differ from the ones of the author. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On Monday 23 May 2011 15:08:41, Jacek Generowicz wrote: On 2011 May 23, at 14:42, Daniel Fischer wrote: On Monday 23 May 2011 14:16:43, Jacek Generowicz wrote: If by cabal install you mean use the command cabal ... yeah, that would be great, if only I could install cabal-install, which fails. With what error? Downloading and unpacking the .tar.gz bundle and then running $ ./bootstrap.sh in that directory should work. Below is what I get *now* having just successfully installed a fresh GHC 7.0.3 and HP 2011.2.0.1. By successfully installed I mean that configure, make and make install didn't throw up any errors. I haven't tested that anything works yet. $ ./bootstrap.sh Checking installed packages for ghc-7.0.3... parsec-2.1.0.1 will be downloaded and installed. Hmmm? network is already installed and the version is ok. Cabal-1.8.0.2 will be downloaded and installed. That's a bad sign. Have you downoaded the bundle from the cabal-install page? That's not the right thing to do (yeah, somebody should tell unsuspecting travellers). With ghc-7, you should use cabal-install-0.10.*, download cabal- install-0.10.2 from hackage http://hackage.haskell.org/package/cabal-install mtl-1.1.0.2 will be downloaded and installed. HTTP-4000.0.8 will be downloaded and installed. zlib is already installed and the version is ok. Downloading parsec-2.1.0.1... ... Downloading Cabal-1.8.0.2... ... [56 of 58] Compiling Distribution.Simple.UserHooks ( Distribution/ Simple/UserHooks.hs, Distribution/Simple/UserHooks.o ) [57 of 58] Compiling Distribution.Simple ( Distribution/Simple.hs, Distribution/Simple.o ) [58 of 58] Compiling Main ( Setup.hs, Setup.o ) Linking Setup ... Configuring Cabal-1.8.0.2... Setup: At least the following dependencies are missing: base =4 3 =1 5, filepath =1 1.2 You see that that constraint is impossible, don't you? Error during cabal-install bootstrap: Configuring the Cabal package failed Okay, $ghc-pkg unregister parsec-2.1.0.1 (unless you want to keep it) Try it with cabal-install-0.10.2, sorry for the inconvenience. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On 2011 May 23, at 15:08, Jacek Generowicz wrote: On 2011 May 23, at 14:42, Daniel Fischer wrote: $ ./bootstrap.sh in that directory should work. Configuring Cabal-1.8.0.2... Setup: At least the following dependencies are missing: base =4 3 =1 5, filepath =1 1.2 How am I supposed to interpret the constraint on base? I read that as it has to be not less than 4 but less than 3 In other words, it requires an *impossible* version of base ! 'ghc-pkg list' claims that I have base 4.3.1.0 filepath 1.2.0.0 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
On 2011 May 23, at 15:22, Daniel Fischer wrote: On Monday 23 May 2011 15:08:41, Jacek Generowicz wrote: Cabal-1.8.0.2 will be downloaded and installed. That's a bad sign. Have you downoaded the bundle from the cabal-install page? Ermmm, ys [sudden pangs of guilt] was that not the right thing to do? That's not the right thing to do Darn! (yeah, somebody should tell unsuspecting travellers). We would kinda appreciate it :-) With ghc-7, you should use cabal-install-0.10.*, download cabal- install-0.10.2 from hackage http://hackage.haskell.org/package/cabal-install Done ... base =4 3 =1 5, filepath =1 1.2 You see that that constraint is impossible, don't you? Yes, but I suspected my inability to read the constraint properly. Okay, $ghc-pkg unregister parsec-2.1.0.1 (unless you want to keep it) Try it with cabal-install-0.10.2, Bingo! sorry for the inconvenience. Marvin I think ... I feel good about it. /Marvin Many, many thanks for your help. (GHC 7.03 is compiling away on OS X, BTW, no glitches so far). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
b) On Ubuntu Natty I installed the generic linux GHC 7.0.3 binary. Downloaded Haskell Platform 2011.2.0.1 source distribution. ./ I just did this (in a pristine virtual machine): * install ubuntu-11.04-desktop-amd64.iso * sudo apt-get install libgmp3-dev zlib1g-dev libglut3-dev * install from binary ghc-7.0.3-x86_64-unknown-linux.tar.bz2 * install from source haskell-platform-2011.2.0.1.tar.gz and this definitely works, i.e. 'ghc-pkg list' shows the platform modules, and no errors. J.W. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Haskell] ANNOUNCE: time-recurrence-0.1
Thanks for the feed back. Very nice. Please put it up on hackage so we can see the haddocks, try it out easily, etc. I've registered for an account, and will have it up on Hackage just as soon as I can. For now you can see the Haddock docs for the library at: http://hellertime.github.com/time-recurrence You are correct that it is worth creating a separate module for that. Please do so! Include neater versions of the corresponding functions from Data.Time. I'll investigate what it will take to improve things in this regard. Ashley, your input would obviously be appreciated in this matter. provide an alternative safe interface. Similarly for toEnum Yitz, are you suggesting something like doing modulo arithmetic rather than calling error on undefined values? At one point I investigated a really generalised version of this, including an abstract syntax type and perhaps a way of parsing some useful subset of English expressions into it Ashley, this sounds quite ambitious and certainly would be an interesting project to work on. I think the scope of this current project is much smaller, but perhaps might be a useful building block or more likely just some simple RD. Regarding the current time-recurrence library, I've started looking into combining the filter operations (byMonth, byYearDay, byWeekNumber, etc...) to build a single function that can enumerate the dates in the recurrence. I may be interesting to see how things would work if instead of creating an enumerating function I created a RangedSet. -Chris On Mon, May 23, 2011 at 2:35 AM, Yitzchak Gale g...@sefer.org wrote: Moving the discussion from haskell to haskell-cafe. Chris Heller wrote: http://github.com/hellertime/time-recurrence A library for generating and inspecting recurring times. Very nice. Please put it up on hackage so we can see the haddocks, try it out easily, etc. hoping to solicit some feedback on its design. Very well done. I have been think about recurrence rules, too. Version 2 Olson timezone files contain POSIX rules to specify clock change rules for times later than the last one listed in the timezone series. Currently, the timezone-series package ignores those. I like your introduction of symbolic months and weekdays. The numeric-only interface of Data.Time for those things leads to messiness like multiple functions depending on how you number the weekdays. That logic should be moved out to a separate interface. You are correct that it is worth creating a separate module for that. Please do so! Include neater versions of the corresponding functions from Data.Time. Another comment - I would have used fromGregorianValid instead of fromGregorian. It's not a good idea for a basic time library to introduce possible crashes. At least you should provide an alternative safe interface. Similarly for toEnum. The general direction is to have something that works much like the RRULE portion of the iCalendar (RFC 5545) specification. I have decided avoid strict RFC compliance at this time. Ashley Yakeley wrote: At one point I investigated a really generalised version of this, including an abstract syntax type and perhaps a way of parsing some useful subset of English expressions into it. However I got stuck on such things as any day after the sixth Sunday of a month In order to prove that today was not such a day, it would have know that sixth Sunday of a month never happens. Simply searching into the past for one would never terminate. Either I would have to restrict the language, or assert the beginning of time (not necessarily a bad solution). I don't see why you would need to make any such restrictions. There would only be a finite number of primitive comparison types, and since your language would be total, any expression could be reduced to the primitive ones in a finite number of steps. Then it would just be a matter of arithmetic on sets of ranges; see, for example, http://hackage.haskell.org/package/Ranged-sets That allows for half-infinite and infinite ranges as well. Regards, Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
The thing that's usually failing is cabal install unix-compat, which requires sudo apt-get install libbsd-dev. - J.W. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
Summarizing, by answering my own question on the basis of the help I have received elsewhere in the thread. On 2011 May 23, at 11:17, Jacek Generowicz wrote: a) Am I right in concluding that GHC 7.0.3 will not run on OS X 10.5 (without unreasonable effort)? It takes little effort on the part of the human, though the CPU will have to work hard. - Make sure you have XCode 3.1 (or better, I guess) - Download and install GHC-7.0.1 http://www.haskell.org/ghc/download_ghc_7_0_1#macosxintel - Use the above to compile GHC-7.0.3 from source. b) On Ubuntu Natty I installed the generic linux GHC 7.0.3 binary. Downloaded Haskell Platform 2011.2.0.1 source distribution. ./ configure worked happily. make fails as follows. Building transformers-0.2.2.0 /usr/local/haskell-platform-2011.2.0.1/bin/ghc --make Setup - o Setup -package Cabal-1.10.1.0 command line: cannot satisfy -package Cabal-1.10.1.0: Cabal-1.10.1.0-1fb2094e19492373b1a39284193e7984 is unusable due to missing or recursive dependencies: process-1.0.1.5-55dfaccf3a91c4cb8f6284a0bafef198 Could anybody help me get past this problem? This problem was probably caused by having an old ~/.ghc lying around. On a *clean* Natty system, this procedure works like a charm, though you may have to apt-get install some required C libraries. If you then proceed to install cabal-install, make sure *not* to use the version which is available for download (today) on the cabal- install page: for GHC 7 you need to use cabal-install version 0.10.*, which you can get from http://hackage.haskell.org/package/cabal-install Use the booststrap.sh script which comes in the bundle (chmod u+x bootstrap.sh; ./bootstrap.sh). Thanks to all those who helped. Hopefully this summary will be of some use to someone in the future. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The Lisp Curse
Librarians have been struggling for years with classifying topics; I don't imagine classifying coding libraries as any easier. :) -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform
On Fri, May 20, 2011 at 11:12 PM, Simon Meier iridc...@gmail.com wrote: There, seems to be a historical artefact here. The new Write abstraction in system-io-write is different from the one used in blaze-builder. It's type is data Write a = Write Int (a - Ptr Word8 - IO (Ptr Word8)) This definition ensures that the bound on the number of bytes written is independent of the value being encoded. That's crucial for the implementation of `mapWriteByteString`. It also benefits the other Write combinators, as the bound can always be computed in a data-independent fashion. Inlining, is therefore really sufficient to arrive at a constant bound during compile time. I don't see why this makes a difference, you could still do myWrite x = Write (length x) (\ _ p - pokePokePoke p x) I don't see how this Write type can be emulated using `writeAtMost`, do you? There's no difference, as I showed above. Both can result in data dependent lengths. It's up to the programmer to make sure the length is independent of the value being written, when so desired. Hmm, all my Writes are top-level function definitions annotated with {-# INLINE #-}. Moreover, all combinators for Writes are also inlined and all their calls are saturated. Therefore, I thought GHC is capable of optimizing away the pattern matches on the Write constructor. You also need to make all top-level functions non-recursive but from what I remember you did so. The case for Writes is the same as for higher-order arguments, the call site must meet the definition site. So if you have something like: myWrite :: Write Word8 writeList :: Write a - [a] - ... f xs = writeList myWrite xs we need to make sure both myWrite and writeList are inlined into f. The case is similar for writeAtMost. The question is what happens if the user ever fails to get everything to inline optimally. In the writeAtMost case just have an indirect function call instead of a direct one. In the Write case we also have extra allocation and indirection. We've had such problems in e.g. attoparsec. While things should inline properly in big programs they rarely do. Same problem exists for fusion where fusion constructors end up in the final program although they should have been eliminated. I'm happy to remove Writes, if there's a superior way of sharing the low-level encoding code that they abstract. However, I did peek at Core from time to time and found that the Write constructors were optimized away. I currently see Writes as an expert domain to be used by authors of libraries like bytestring, text, aeson, blaze-html, etc. With appropriate documentation and benchmarks I expect them to be able to make good choices w.r.t. inlining and partial application. I agree. Writes (and writeAtMost) would be the domain of experts. If we expects write to be reused a lot it might make sense to have a separate Write type. Note that I'd be reluctant to see dependencies that involve I/O underneath bytestring as it's designed as a pure data structure library (and is likely to have things involving I/O on top of it). Cheers, Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [Maybe Int] sans Nothings
What's the best way to end up with a list composed of only the Just values,no Nothings? Michael == import Control.Monad.Stateimport Data.Maybe type GeneratorState = State Int tick :: GeneratorState (Maybe Int)tick = do n - get if ((n `mod` 7) == 0) then return Nothing else do put (n+1) return (Just n) {-*Main evalState (sequence $ replicate 9 tick) 1[Just 1,Just 2,Just 3,Just 4,Just 5,Just 6,Nothing,Nothing,Nothing]-} ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHC 7, Platform 2011.2 vs OS X 10.5, Ubuntu 11.04
Cabal-1.8.0.2 will be downloaded and installed. That's a bad sign. Have you downoaded the bundle from the cabal-install page? Ermmm, ys [sudden pangs of guilt] was that not the right thing to do? That's not the right thing to do Darn! (yeah, somebody should tell unsuspecting travellers). We would kinda appreciate it :-) This gave me some deja vu so I checked my sent mail, turns out on May 19 I wrote about the same thing. I updated one wiki page to not point to that cabal page, but I don't have permissions to take down the page itself. No one responded to my email so I forgot I had sent it and never been answered. So I repeat: If you search for cabal install, the first link is http://hackage.haskell.org/trac/hackage/wiki/CabalInstall, which in turn leads to http://haskell.org/cabal/download.html. It looks very official and canonical and all that, but that page has an old version of cabal install that will no longer compile with ghc7 because it requires old libraries. Of course it won't tell you that right off, first it will install a whole bunch of old stuff, charge you a fiver, and then emit some constraint can't be satisfied msgs which if you have some experience with haskell and cabal already should eventually tip you off that something's wrong. Is there someone out there who has permissions to either take that page down, or replace it with a link to the new version at http://hackage.haskell.org/package/cabal-install? I updated http://hackage.haskell.org/trac/hackage/wiki/CabalInstall to point to the platform and to the hackage page, but the cabal page at http://haskell.org/haskellwiki/Cabal-Install still links to http://haskell.org/cabal/download.html. Should I just replace the haskellwiki page with a link to the hackagewiki one? I would try to port over any up to date info of course. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
On 23 May 2011, at 17:20, michael rice wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? Go to haskell.org/hoogle Type in [Maybe a] - [a] Click on first result. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
On 5/23/11 9:20 AM, michael rice wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? Try catMaybes in Data.Maybe. Cheers, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
On 23 May 2011 17:20, michael rice nowg...@yahoo.com wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? http://haskell.org/hoogle/?hoogle=%3A%3A+%5BMaybe+a%5D+-%3E+%5Ba%5D Data.Maybe.catMaybes is what you want :-) Cheers, Max ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
On 23 May 2011, at 17:20, michael rice wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? Alternatively, [ x | Just x - originals ] It also occurs to me that perhaps you still want the Just constructors. [ Just x | Just x - originals ] [ x | x@(Just _) - originals ] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
On 5/23/11 9:29 AM, Max Bolingbroke wrote: On 23 May 2011 17:20, michael rice nowg...@yahoo.com mailto:nowg...@yahoo.com wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? http://haskell.org/hoogle/?hoogle=%3A%3A+%5BMaybe+a%5D+-%3E+%5Ba%5D Data.Maybe.catMaybes is what you want :-) Cheers, Max On 5/23/11 9:25 AM, Malcolm Wallace wrote: On 23 May 2011, at 17:20, michael rice wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? Go to haskell.org/hoogle Type in [Maybe a] - [a] Click on first result. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe On 5/23/11 9:25 AM, Gregory Crosswhite wrote: On 5/23/11 9:20 AM, michael rice wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? Try catMaybes in Data.Maybe. Cheers, Greg GO TEAM HASKELL!!! Cheers, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The Lisp Curse
In terms of making the interface more friendly to beginners, I wonder if this is partially an issue of how to search and how to format the results. I just searched several places for xml rpc and found: Hackage: the first few links from the google search are different versions of haxr Hayoo: 0 packages found, but lists functions from packages including haxr Hoogle: No results found Haskell.org: No matches When that happens I can broaden my search (just RPC or just XML), or I can go to google and search haskell xml rpc and find results, but without any sense of what I should be clicking on. I'll often start in one place, then hear about something on Haskell-Cafe that's more widely used and never came up in the results. I realize Hayoo and Hoogle are specialized searches (although I imagine people do occasionally use them the way I did in this example), but it would be great if Hackage's search feature could provide its own summary results in a simple table, perhaps like this: Date Released | Last Updated | Downloads | Focus Where focus is a one or two liner explaining the intended use or scope of the package, ideally written with comparisons to similar packages in mind. That way if you search xml rpc and are immediately given results for a couple of packages, you can get some sense of what's current, what's being used, and the scope or intended use of the package. I'm not sure if this format would work for everyone of course, but I do think some of the ideas coming out of this discussion are promising. And for my part, I'm going to make an effort to participate on the wiki once I wrap a couple projects. Best, Eric On Mon, May 23, 2011 at 8:31 AM, KC kc1...@gmail.com wrote: Librarians have been struggling for years with classifying topics; I don't imagine classifying coding libraries as any easier. :) -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Further installation adventures
I'm trying to cabal install lambdabot. This depends on a squillion other libraries, which cabal tries to install, among which is readline, which fails to configure as follows. Configuring readline-1.0.1.0... checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for GNUreadline.framework... checking for readline... no checking for tputs in -lncurses... no checking for tputs in -ltermcap... no checking for tputs in -lcurses... no checking for rl_readline_version... no configure: error: readline not found, so this package cannot be built See `config.log' for more details. cabal: Error: some packages failed to install: readline-1.0.1.0 failed during the configure step. The exception was: ExitFailure 1 From which I conclude that it can't find the readline library. I have all sorts of flavours of readline on my system, so I'll need a bit more information about what exactly it's looking for. It tells me to look in config.log. I presume that this is the config log of the cabal package readline, which cabal automatically downloaded, unpacked ... and presumably automatically cleaned up at the end, because I can't find it anywhere. Where should I be looking for the relevant config.log? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Further installation adventures
Excerpts from Jacek Generowicz's message of Mon May 23 19:15:53 +0200 2011: Where should I be looking for the relevant config.log? Maybe you're missing header files? is there a readline-dev package for your distro? also open the cabal file and watch for include or library directorie settings. Maybe they don't fit your distro. Marc Weber ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
On Mon, May 23, 2011 at 9:20 AM, michael rice nowg...@yahoo.com wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? Michael == import Control.Monad.State import Data.Maybe type GeneratorState = State Int tick :: GeneratorState (Maybe Int) tick = do n - get if ((n `mod` 7) == 0) then return Nothing else do put (n+1) return (Just n) {- *Main evalState (sequence $ replicate 9 tick) 1 [Just 1,Just 2,Just 3,Just 4,Just 5,Just 6,Nothing,Nothing,Nothing] -} There's a library function for it, but also: filter ((/=) Nothing) is readable enough. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
Thanks, all. Earlier, I was going to ask how to break out of a sequence op prematurely, i.e., you give it some replication number but want to break early if you get an end-flag value. While I was composing the post I thought of using Maybe for the good values and Nothing for the end value. Ergo, losing the Nothings at the end. I was passing a map and an empty list into some state, but since the map doesn't change once it's created I moved it into a Reader. I was using the list to collect the elements but thought I can get that functionality automatically using sequence. So, one thing leads to another. It's interesting how ideas begin bubbling up after one absorbs some critical mass of Haskell. Michael --- On Mon, 5/23/11, Malcolm Wallace malcolm.wall...@me.com wrote: From: Malcolm Wallace malcolm.wall...@me.com Subject: Re: [Haskell-cafe] [Maybe Int] sans Nothings To: haskell-cafe Cafe haskell-cafe@haskell.org Date: Monday, May 23, 2011, 12:35 PM On 23 May 2011, at 17:20, michael rice wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? Alternatively, [ x | Just x - originals ] It also occurs to me that perhaps you still want the Just constructors. [ Just x | Just x - originals ] [ x | x@(Just _) - originals ] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Further installation adventures
On 2011 May 23, at 19:31, Marc Weber wrote: Excerpts from Jacek Generowicz's message of Mon May 23 19:15:53 +0200 2011: Where should I be looking for the relevant config.log? Maybe you're missing header files? I checked whether the -dev packages were installed, and they were present ... but your message prompted me to check again, and it turns out that I had deluded myself. So, yes, absence of headers turned out to be the problem. Thanks. Onward. Readline has installed, But now 'cabal install lambdabot' fails almost exactly like this: http://hpaste.org/46397/lambdabot_install_failure (Note, that paste isn't mine, it popped up in a Google search.) Any suggestions, anyone? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Building Haskell Platform natively for 64bit Windows
On Mon, May 23, 2011 at 4:32 AM, Simon Marlow marlo...@gmail.com wrote: On 18/05/2011 19:22, Jason Dagit wrote: On Wed, May 18, 2011 at 2:50 AM, John Sneerjohnsn...@operamail.com wrote: Hello all, I know it is not probably good question to this list, but anyway, could anyone point me to some more detailed how to where is described building of Haskell Platform natively to 64bit Windows? If you figure out how to do this, I would like to know as well. I could also benefit from 64bit Haskell on windows. There is no port of GHC to 64-bit Windows yet. Various people have expressed an interest in having one, but it is a significant chunk of work to implement (plus extra work to maintain and build distributions), so we don't have any plans to do it in the short term. You can track progress (or lack thereof) by adding your email to the CC on the ticket: http://hackage.haskell.org/trac/ghc/ticket/1884 Thanks! I'm trying to add myself to the ticket but I'm having some issues. I've had lots of account issues on the ghc trac over the years. I've created several usernames but never been able to login consistently with them so I normally use the guest account. To add myself to that ticket I think I need a non-guest account. Here is what seems to be happening: * I try to login with 'dagit' but I don't know the password * I try to reset the password but I can't seem to get the right username/email combo * I try to create a new account (the error message in the previous step is ambiguous enough that I thought maybe the 'dagit' account doesn't exist), but it says the account exists. * I'm asking for assistance in #ghc but no one has helped me yet On a side note, the captcha for account creation is VERY hard to read (I got it wrong 3 times in a row, and as far as I know I'm human). If you want to help out, join cvs-...@haskell.org and we can help with pointers to what needs to be done. I think I'm on that list already. I'm very happy to help in anyway that I can. Do you already have a build machine for testing a 64bit build? Thanks, Jason ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] code review?
'if all == False then return False else return True' is a pretty confusing way to say 'return all'. In fact, any time you see 'x == True' you can just remove the '== True'. The whole postAll thing would be clearer as Before doing a code review I always demand that the author runs over the code with HLint (http://community.haskell.org/~ndm/hlint) - they don't have to necessarily apply all the suggestions, but they do have to at least be aware of obvious alternatives. A code review takes a reasonable amount of time, and it's best to use that for things that machines can't yet figure out - rather than the simpler stuff like the above. Thanks, Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
On Mon, May 23, 2011 at 10:49:55AM -0700, Alexander Solla wrote: On Mon, May 23, 2011 at 9:20 AM, michael rice nowg...@yahoo.com wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? Michael == import Control.Monad.State import Data.Maybe type GeneratorState = State Int tick :: GeneratorState (Maybe Int) tick = do n - get if ((n `mod` 7) == 0) then return Nothing else do put (n+1) return (Just n) {- *Main evalState (sequence $ replicate 9 tick) 1 [Just 1,Just 2,Just 3,Just 4,Just 5,Just 6,Nothing,Nothing,Nothing] -} There's a library function for it, but also: filter ((/=) Nothing) is readable enough. Just a minor quibble: note that filter (not . isNothing) is slightly preferable since it does not introduce a frivolous equality constraint on the type wrapped by the Maybe. -Brent ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
On 05/23/2011 12:08 PM, Brent Yorgey wrote: Just a minor quibble: note that filter (not . isNothing) is slightly preferable since it does not introduce a frivolous equality constraint on the type wrapped by the Maybe. Or even better, filter isJust :-) Cheers, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
Brent Yorgey schrieb: On Mon, May 23, 2011 at 10:49:55AM -0700, Alexander Solla wrote: There's a library function for it, but also: filter ((/=) Nothing) is readable enough. Just a minor quibble: note that filter (not . isNothing) is slightly preferable since it does not introduce a frivolous equality constraint on the type wrapped by the Maybe. Similar: http://www.haskell.org/haskellwiki/Haskell_programming_tips#Reduce_type_class_constraints http://www.haskell.org/haskellwiki/Haskell_programming_tips#Don.27t_ask_for_the_length_of_a_list_when_you_don.27t_need_it ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
Gregory Crosswhite gcr...@phys.washington.edu wrote: Or even better, filter isJust To make it worse again the original function can be generalized in a few ways. Here is a generalization from the inner Maybe type: import Data.Foldable as F catFoldables :: Foldable t = [t a] - [a] catFoldables = concatMap F.toList Here is a generalization from the outer list type: joinMaybes :: (Alternative m, Monad m) = m (Maybe a) - m a joinMaybes = (= maybe empty pure) And finally the generalization from everything: import Data.Foldable as F joinFoldables :: (Alternative m, Foldable t, Monad m) = m (t a) - m a joinFoldables = (= F.foldr (\x _ - pure x) empty) The final function looks a bit scary, but is actually surprisingly easy to understand, once you realize that 'foldr' is just a generalization of the 'maybe' function. The structure of Maybe is a list structure with at most one element after all. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife = sex) http://ertes.de/ -- nightmare = unsafePerformIO (getWrongWife = sex) http://ertes.de/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Imports in complex Setup.hs -- should we encourage/require PackageImports?
Several libraries (notably Pandoc and Gtk2hs) have very complex Setup.hs scripts, which import several external libraries. In my experience, these imports are very fragile, because Cabal does not enforce package visibility in Setup.hs. For example, a Setup.hs that imports Control.Monad.Trans will break if monads-tf is installed, and one that imports System.FilePath will break if system-filepath is installed. My typical solution when this happens is to manually tweak the GHC package database before installing, but this is annoying and does not help other users. Based on a ticket in Cabal's Trac http://hackage.haskell.org/trac/hackage/ticket/326 , custom Setup.hs scripts are discouraged by the Cabal developers. I assume this means there will not be much development effort put towards an integrated solution (such as using -hide-all-packages and build-depends: when compiling Setup.hs). A possible solution is to ask developers with complex Setup.hs requirements to use the PackageImports language extension when importing external libraries. However, this places a burden on such developers, and I don't know if it's portable to non-GHC compilers. It would also need an analysis of currently published Hackage packages to see which have such scripts. Any ideas/comments? Has anyone by chance found a good solution to this? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Maybe Int] sans Nothings
On 24/05/2011, at 5:49 AM, Alexander Solla wrote: There's a library function for it, but also: filter ((/=) Nothing) The problem with that in general is that it only applies to [Maybe t] if Eq t, but you don't actually _need_ t to support equality. filter isJust will do the job, where isJust is in Data.Maybe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Cabal: wrapping namespace of a package into top-level module
Hi haskell-cafe. I have a package which builds with cabal pretty fine, but there is namespace issue which disturbs me. The problem is that the package exports (to the toplevel namespace!) some modules with fairly general names, like Tests, Basics, Applications. This is probably an oversight of the original package author, and the namespace shouldn't be organised like this... but it is. And I'm looking for a way to avoid potential namespace troubles should I install the package, other than going and reforming the namespace tree myself. What I was thinking about was some cabal option to wrap package's namespace into a toplevel module, say PackageName, so that module Tests could be imported by usual code with `import PackageName.Tests`. Is that possible with cabal? Things are further complicated by the numerous intra-library imports. While the outside code refers to a module with PackageName.ModuleName, it would be very desirable that inside code used just straight ModuleName. -- Regards, max ulidtko signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal: wrapping namespace of a package into top-level module
On 24 May 2011 14:38, max ulidtko ulid...@gmail.com wrote: Hi haskell-cafe. I have a package which builds with cabal pretty fine, but there is namespace issue which disturbs me. The problem is that the package exports (to the toplevel namespace!) some modules with fairly general names, like Tests, Basics, Applications. This is probably an oversight of the original package author, and the namespace shouldn't be organised like this... but it is. And I'm looking for a way to avoid potential namespace troubles should I install the package, other than going and reforming the namespace tree myself. What I was thinking about was some cabal option to wrap package's namespace into a toplevel module, say PackageName, so that module Tests could be imported by usual code with `import PackageName.Tests`. Is that possible with cabal? Things are further complicated by the numerous intra-library imports. While the outside code refers to a module with PackageName.ModuleName, it would be very desirable that inside code used just straight ModuleName. The only real option I can think of is to use GHC's package imports functionality: http://haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#package-imports . However, its usage is usually discouraged. -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal: wrapping namespace of a package into top-level module
On Tue, May 24, 2011 at 00:38, max ulidtko ulid...@gmail.com wrote: I have a package which builds with cabal pretty fine, but there is namespace issue which disturbs me. The problem is that the package exports (to the toplevel namespace!) some modules with fairly general names, like Tests, Basics, Applications. This is probably an oversight Sadly that isn't so much a Cabal issue as something deeper inside ghc. I could imagine something using ghc-api to accomplish it, but that goes well outside of what cabal can cope with. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics
Last I tried, there wasn't native support for OpenGL with gtk, and I need OpenGL. Then more recently, I heard of some progress in that area, but requiring lots of hacking to get it all compiling. Any recent news? - Conal On Mon, May 23, 2011 at 2:33 AM, John Lato jwl...@gmail.com wrote: Message: 17 Date: Fri, 20 May 2011 15:59:51 -0700 From: Evan Laforge qdun...@gmail.com Subject: Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics To: Erik Hesselink hessel...@gmail.com Cc: haskell-cafe@haskell.org Message-ID: BANLkTi=74mm6ortu2e192jtoot9g49f...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 Note that it is supposed to be possible to build gtk2hs with gtk+osx, which will not use X11 but use the native OS X GUI. I've not been able to get this to work, but it's been a while since I tried. The Haskell wiki mentions it doesn't support Glade, but does support Cairo. If this were to work, gtk2hs would be a serious option as well. I've tried this 3 or 4 times, and failed every time. It's crazy complicated. I used to use this combination regularly. IME the difficulties are primarily with getting a working gtk+osx build. Once that was accomplished, gtk2hs was a straightforward install, provided you build from the src repo with the -quartz flag. Recently I've switched to using macports gtk2 with the quartz, no-x11 variant, which also uses native cocoa. This is much more reliable than gtk+osx. I don't know if it supports Glade though. My biggest problem with wx is that there's no support for building 64-bit wx applications on OS X. If that were fixed I might prefer it. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] *GROUP HUG*
Hey everyone, Okay, this will sound silly, but I ventured into the Scala mailing list recently and asked an ignorant question on it, and I was shocked when people reacted not by enlightening me but by jumping on me and reacting with hostility. I bring this up not to badmouth the Scala community (they are apparently going through growing pains and will hopefully mature with time!) but just because it made me appreciate just how awesome you guys are, so I just feel the need to publicly express my admiration and thank to everyone on this list for having fostered such an incredibly professional, fanatically nonhostile, and generally pleasant place to talk about Haskell!!! *GROUP HUG* Okay, I'm done now. :-) Cheers, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] *GROUP HUG*
The community plays a large part of why I am using Haskell professionally. The Haskell ecosystem is first-rate all by itself, but I would have been dead in the water months ago without the community. On Mon, May 23, 2011 at 10:10 PM, Gregory Crosswhite gcr...@phys.washington.edu wrote: Hey everyone, Okay, this will sound silly, but I ventured into the Scala mailing list recently and asked an ignorant question on it, and I was shocked when people reacted not by enlightening me but by jumping on me and reacting with hostility. I bring this up not to badmouth the Scala community (they are apparently going through growing pains and will hopefully mature with time!) but just because it made me appreciate just how awesome you guys are, so I just feel the need to publicly express my admiration and thank to everyone on this list for having fostered such an incredibly professional, fanatically nonhostile, and generally pleasant place to talk about Haskell!!! *GROUP HUG* Okay, I'm done now. :-) Cheers, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] *GROUP HUG*
2011-05-23 22:10 -0700, Gregory Crosswhite: Hey everyone, Okay, this will sound silly, but I ventured into the Scala mailing list recently and asked an ignorant question on it, and I was shocked when people reacted not by enlightening me but by jumping on me and reacting with hostility. I bring this up not to badmouth the Scala community (they are apparently going through growing pains and will hopefully mature with time!) but just because it made me appreciate just how awesome you guys are, so I just feel the need to publicly express my admiration and thank to everyone on this list for having fostered such an incredibly professional, fanatically nonhostile, and generally pleasant place to talk about Haskell!!! *GROUP HUG* Okay, I'm done now. :-) Cheers, Greg Wow. I subscribed to the list just an hour ago or so, and already receiving hugs! That's kinda... striking, you know. Yay! Newbie hug to everyone too! - max ulidtko signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe