RE: [Haskell-cafe] cabal update doesn't work on Windows XP
Whenever I do cabal update, the response is Unsuccessful HTTP code 403. That looks like the hackage server isn't responding, but other software tools (browsers, etc) on the computer can download the hackage database; the only program that can't get it is cabal. Do you use an http proxy? If so, you'll need to set the HTTP_PROXY env var. Alistair Invesco Fund Managers Limited, Company No. 898166, FSA No. 119298 Invesco Asset Management Limited, Company No. 949417, FSA No. 122674 Invesco Global Investment Funds Limited, Company No. 1046873, FSA No. 141663 Invesco Perpetual Life Limited, Company No. 3507379, FSA No. 188249 Invesco UK Limited, Company No. 3004959 The first four listed companies are authorised and regulated by the Financial Services Authority. All companies are incorporated in England and registered at 30 Finsbury Square, London EC2A 1AG. UK Group VAT No. 245 055 771. * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] London HUG domain expired
From: sefer@gmail.com [mailto:sefer@gmail.com] On Behalf Of Yitzchak Gale On Fri, Apr 23, 2010 at 1:24 PM, Bayley, Alistair wrote: Looks like the London HUG domain (londonhug.net) registration has expired. Neil Bartlett was the registrant. Neil: do you plan to renew? The whois database reports: Domain name: LONDONHUG.NET This domain name is up for auction for a limited time. To place a bid, visit: http://www.namejet.com And it appears that someone has already placed a $75 bid. The domain should be renewed promptly, before the grace period expires. Probably the best option, but can anyone other than Neil do this? If not, does anyone know if Neil is reachable? (could try his phone number listed in the whois record, but that seems a little invasive). Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: [Haskell-cafe] London HUG domain expired
From: sefer@gmail.com [mailto:sefer@gmail.com] On Behalf Of Yitzchak Gale On Fri, Apr 23, 2010 at 1:24 PM, Bayley, Alistair wrote: Looks like the London HUG domain (londonhug.net) registration has expired. Neil Bartlett was the registrant. Neil: do you plan to renew? The whois database reports: Domain name: LONDONHUG.NET This domain name is up for auction for a limited time. To place a bid, visit: http://www.namejet.com And it appears that someone has already placed a $75 bid. The domain should be renewed promptly, before the grace period expires. Probably the best option, but can anyone other than Neil do this? If not, does anyone know if Neil is reachable? (could try his phone number listed in the whois record, but that seems a little invasive). Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
London HUG domain expired
From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-users-boun...@haskell.org] On Behalf Of Denys Rtveliashvili On the side note, is London HUG still active? The website seems to be down... Looks like the London HUG domain (londonhug.net) registration has expired. Neil Bartlett was the registrant. Neil: do you plan to renew? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] London HUG domain expired
From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-users-boun...@haskell.org] On Behalf Of Denys Rtveliashvili On the side note, is London HUG still active? The website seems to be down... Looks like the London HUG domain (londonhug.net) registration has expired. Neil Bartlett was the registrant. Neil: do you plan to renew? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: why doesn't time allow diff of localtimes ?
bri...@aracnet.com Maciej Piechotka uzytkown...@gmail.com wrote: On Wed, 2010-03-31 at 19:29 -0700, bri...@aracnet.com wrote: wagne...@seas.upenn.edu wrote: Two values of LocalTime may well be computed with respect to different timezones, which makes the operation you ask for dangerous. First convert to UTCTime (with localTimeToUTC), then compare. that makes sense. unfortunately getting the current timezone to convert to UTC results in the dreaded IO contamination problem... Brian Hmm. Where do you get the local times from in the first place? read it from a file of course :-) I think I've got it figured out. it's not too ugly. One interesting hole in the system is that buildTime can return a LocalTime _or_ a UTCTime. That means the same string used to generate a time can give you two different times. It seems as thought it should be restricted to always returning a UTCTime. If it's going to return a local time it should require an extra argument of a timezone, shouldn't it ? LocalTime is just day+time, sans TimeZone (so it could be in any timezone). ZonedTime is LocalTime with TimeZone. The functions to convert to UTCTime give a clue: zonedTimeToUTC :: ZonedTime - UTCTime localTimeToUTC :: TimeZone - LocalTime - UTCTime i.e. ZonedTime can convert with no additional information (so in a sense is equivalent), but for LocalTime you need to say which TimeZone to use. If all you have in your file is day_time, you're going to have to get a TimeZone from somewhere, in order to convert to UTCTime. If all you're doing is diffing the LocalTimes, and they are all in the same TimeZone, then any TimeZone will do, I guess. Perhaps add what you learn to one or more of these pages: http://haskell.org/haskellwiki/Cookbook/Dates_And_Time http://haskell.org/haskellwiki/Libraries_and_tools/Time_library or create a new wiki page with better docs for Data.Time? (aside: do we have a policy for naming pages that augment library documentation? what about under here? http://haskell.org/haskellwiki/Library e.g. http://haskell.org/haskellwiki/Library/Time ) Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] cabal through PHPProxy
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Dupont Corentin i'm using PHPProxy to go on the internet (www.phpproxy.fr). How can i tell cabal to use this? I think the normal way is through setting HTTP_PROXY env var e.g. set HTTP_PROXY=http://localhost:3128 (I have a cntlm proxy on my local machine because our corporate proxy uses NTLM authentication, which cabal does not support.) Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Haskell and XML, need some tips from practioners
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Günther Schmidt Anyway through a very, very tedious process of xslt-transformations I finally have the XML document I need. But now I need to amend the attributes of some elements with looked up values from the outside, the lookup-key is a particular attribute value of the nodes. This I cannot do through xslt processing as the information needed is not within the xml document. Not the answer you were looking for, but... Is the lookup table in another XML document? If so then you might well be able to use the document() function, if your xslt processor supports it e.g. xsl:value-of select=document($lookup-file)/ROWSET/ROW/FUND/FUND_ROW[FND_ID=$fnd-id]/ISIN_CODE/ That said, if you can, use Haskell to do all the transformations i.e. avoid xslt altogether. I despise xslt. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: Haskell and XML, need some tips from practioners
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Günther Schmidt You guys are right though, through the document function it would be possible. So any particular tool-set you could recommend? On Windows, the Microsoft xslt processor supports document(), I believe. Other than that, I have no recommendations. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] About code style ?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of zaxis For me i like C style instead of layout. For example, func1 a = do { -- ...; a * 2; -- ...; } The report has all the gory details. The brace+semicolon syntax isn't just for do-blocks; it can be used anywhere that indenting is used to specify scope. Section 2.7: http://www.haskell.org/onlinereport/lexemes.html#lexemes-layout Section 9.3: http://www.haskell.org/onlinereport/syntax-iso.html#layout Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] big problems with MS Access backends
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Günther Schmidt I need to use MS Access as a DB-backend. To make it not too easy there are tables with Umlaut Strings in some of the columns. And Takusen crashes outright. Can you try Takusen from the darcs repo? It was at darcs.haskell.org, but now Ian's temporarily moved all the non-ghc projects to http://old-darcs.well-typed.com/, and I haven't found the time to move it to code.haskell.org. I tested with Access and made a bunch of changes to the ODBC driver. It works for me :-) The ODBC tests all pass with Access. Could you run them and see how you get on? To build and run the tests: You probably need to edit the cabal file and comment out modules in the Other-modules: section for the backends that you don't have, and edit the imports and backendTests function in Main.hs. To build the tests you say: setup configure -fbuildtests setup build You will find takusen_tests.exe under dist\build\takusen_tests. Run with this command line: takusen_tests odbc noperf DSN=takusen (noperf just means don't run the performance tests, just the functional tests) This assumes you have created an ODBC DSN called takusen, which points to an Access database. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] RE: ssh ports for monk and nun?
From: libraries-boun...@haskell.org [mailto:libraries-boun...@haskell.org] On Behalf Of Stefan Monnier Trying to get ssh working via putty from behind my company firewall. My recommendation is to get access to an outside machine where you run an OpenVPN server on port 80 or 443. This will solve it once and for all. But first, please complain loudly and repeatedly about the firewall being closed to port 22. Tried and failed. Our firewall will be closed to port 22 for the forseaable future. I'll give the OpenVPN thing a go, if I can find some time. I'm wondering about a couple of things: 1. how many people (in the haskell community) have the same problem? How have they solved or worked around the problem? 2. is it possible to run SSH daemons on monk and nun on ports 80 or 443? I'm wondering both from a technical feasability POV, and also an administrative POV i.e. if it were technically feasible, would the admins be open to the idea, if there was sufficient demand? Thanks, Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] RE: ssh ports for monk and nun?
From: cristiano.pa...@gmail.com [mailto:cristiano.pa...@gmail.com] On Behalf Of Cristiano Paris On Fri, Jan 22, 2010 at 11:38 AM, Bayley, Alistair alistair.bay...@invesco.com wrote: ... Tried and failed. Our firewall will be closed to port 22 for the forseaable future. I'll give the OpenVPN thing a go, if I can find some time. Trying to ask how to pierce your company's firewall in a public mailing list, even from your company's email address, may not be advisable. Well, I wasn't necessarily looking for that kind of advice, more along the lines of how to work with what I have (which is ports 80 and 443, via an http proxy server). I have been able to use CVS+SSH with sourceforge in the past, because they had cvs servers that listened for SSH connections on port 443. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Non-ASCII characters in .cabal files break Haddock?
I recently uploaded a package to Hackage[1], which contains a non-ASCII character in the .cabal file. That file is encoded with UTF-8, and it displays fine in Vim, Firefox, and even the Hackage package landing page. However, Haddock is failing to build it[2] -- apparently it can't handle UTF-8 encoded text properly. In documentation sections, Haddock supports special syntax for escaping non-ASCII. Is there any equivalent syntax for Cabal files? What happens if you use the Haddock syntax in the cabal file (description field)? It's not even certain that Haddock is choking on UTF8 - it might be some other encoding. The description from the cabal file is written to a temp file, and this is passed to haddock with the --prologue option. In your log output we can see: /usr/local/bin/haddock --use-contents=/package/natural-sort-0.1 --prologue=dist/doc/html/natural-sort/haddock-prolog17177.txt ... haddock: internal Haddock or GHC error: dist/doc/html/natural-sort/haddock-prolog17177.txt: hGetContents: invalid argument (Invalid or incomplete multibyte or wide character) So it is actually hGetContents that is choking on the haddock-prolog17177.txt file. That might well depend on the default encoding for the shell that runs the build. What happens on your own machine? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] diff implementation in haskell
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Ketil Malde Don Stewart d...@galois.com writes: http://hackage.haskell.org/package/Diff Wherein we can read: | This is an implementation of the O(ND) diff algorithm [...]. It is O(mn) | in space. At first I thought 'N' and 'M' would be the lengths of the lists, and 'D' is the number of differences, but then the space bound doesn't make sense. I tried to find the reference, but Citeseer is down (again. sigh). Anybody know what the bounds really are? I think the space bounds are O(M+N). Section 4b. A Linear Space Refinement concludes with Unfortunately, the input sequences A and B must be kept in memory, implying that a total of O(M+N) space is needed. BTW, there is a minor improvement to this algorithm (claims to be faster, same space usage): http://research.janelia.org/myers/Papers/np_diff.pdf found via: http://scholar.google.com/scholar?q=%22An+O(NP)+Sequence+Comparison+Algo rithm.%22 I thought this paper was easier to understand. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Haddock Secrets?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Gregory Crosswhite Is there some secret to getting Haddock to work with literate Haskell sources that I am missing? For example, when I download Takusen and type cabal configure cabal haddock It produces HTML files complete with a table of contents, but with all of the documentation stripped out. Oddly, I know that it is *possible* to process the literate sources into documentation because it appears on Hackage! You need a recent version of cabal i.e. = 1.6.0.3. I don't think the haddock version matters much (cabal can handle haddock-1 and haddock-2, I think). The problem is that haddock does not retain literate comments i.e. the .lhs preprocessor is run before haddock parses the file, and literate comments are stripped. This has been fixed in cabal by having cabal preprocess the .lhs file itself, with a special preprocessor that retains literate comments. The resulting .hs file is passed to haddock, and voilà. Before cabal solved the problem, I used to run a similar custom preprocessor over the Takusen source tree, and then invoke haddock manually to create the html docs. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Wiki software?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of S. Doaitse Swierstra How about: http://hackage.haskell.org/package/orchid a simple, but nice wiki produced by one of our students Sebastiaan Visser, You can see it in action here: http://funct.org/wiki/ http://funct.org/wiki/#Building%20a%20Wiki%20in%20Haskell.html Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Opinion about JHC
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of John Meacham On Fri, Nov 13, 2009 at 08:55:51PM +, Lennart Augustsson wrote: That was indeed my point. Since a compiler is a substantial program I would have more confidence it a compiler that is self-hosting. Surely you must have tried? [...] I never understood the desire to have it be self-hosting [...] I think you did, once. Quoting from here (from section The story of jhc): http://repetae.net/computer/jhc/jhc.shtml Writing a compiler is also doubly efficient to begin with, since if you self-compile improvements not only give you a better optimizer, but also speed up your self-compiled compiler. I was looking forward to the day jhc became self-hosting. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] who wrote the Relational_Algebra page
on the Haskell wiki? http://www.haskell.org/haskellwiki/Relational_algebra Günther According to the page history, the userid is EndreyMark. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: How to reliably open and close resources inMonadIO in the presence of exceptions?
-Original Message- From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Bas van Dijk I could of course write a genAlloca if the MonadIO class was extended with a bracket method: Besides extending MonadIO with bracket, maybe it's also useful to extend it with: catch :: Exception e = m a - (e - m a) - m a You might want this library: http://hackage.haskell.org/packages/archive/MonadCatchIO-transformers/0. 0.1.0/doc/html/Control-Monad-CatchIO.html There's also an mtl version; not sure which is to be prefered. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Comments requested: succ Java
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Edward Middleton If you have counterexamples, then perhaps you can name them. I'm looking for Java shops with 5+ developers and code bases of 100k converting over to Haskell. I don't know _any such shop_ that has switched to Haskell, and I doubt any exist, but I'd be delighted to learn I'm wrong. http://portal.acm.org/citation.cfm?doid=1596550.1596578 If you lack an ACM subscription, then this is likely the same document: http://www.starling-software.com/misc/icfp-2009-cjs.pdf Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Haddock and literate Haskell: annotations must bemarked as source?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Andy Gimblett Sent: 24 September 2009 20:19 On 24 Sep 2009, at 20:10, Duncan Coutts wrote: On Thu, 2009-09-24 at 19:48 +0100, Andy Gimblett wrote: That's great news for me, except: that's what I tried first, and I've just tried it again and it still doesn't seem to work for me. Perhaps I am doing something wrong...? You're quite right, it got broken with the move to haddock2. The code in Cabal-1.6 skips the pre-processing when using haddock2, assuming haddock will handle it. In the current Cabal development version it works properly and I get the right output for your example. Ah, righto. In that case, I won't shy away from LHS, and I'll be patient for the next Cabal release, or maybe even check out the development version. :-) Doh. I forgot that little detail. You need cabal 1.6.0.2, which unfortunately is the last released version. The current development one should do it (very easy to install with cabal :-). Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Haddock and literate Haskell: annotations must bemarked as source?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Andy Gimblett It seems to me that Haddock only picks up annotation comments (ie those that should be included in the produced documentation) from literate Haskell source when those annotations are themselves marked up as source - it seems not to recognise them in the general text. It appears the literate version needs to look like this: -- | Turn a foo into a bar foo :: Foo - Bar foo b = ... which to my mind rather defeats the purpose of being literate. So: am I right that this is the intended/expected behaviour? Haddock currently uses ghc's parser, and I believe the literate preprocessor discards comments. I think there is an item on the haddock wishlist to preserve the literate comments, but I'm not certain... This problem has been solved in cabal, BTW. Cabal preprocesses .lhs itself, rather than trust the compiler to do it, and it preserves the comments. If you generate you haddocks with cabal, then you should be able to use the markup the way you expected. The Takusen source files are written in this style. For example, see: http://darcs.haskell.org/takusen/Database/Enumerator.lhs Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: Re[2]: [Haskell-cafe] Re: Where do I put the seq?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Bulat Ziganshin To: Peter Verswyvelen But how does GHC implement the RealWorld internally? I guess look the base library sources for RealWorld http://www.haskell.org/ghc/docs/latest/html/libraries/base/src/GHC-IOBas e.html#IO * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Library function for map+append
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Dusan Kolar During a small project I'm trying to develop a small application. It becomes quite often that I need a function mapapp: mapapp _ [] ap = ap mapapp f (a:as) ap = f a : map f as ap I tried hoogle to find such a function with no success. Is there any function/functions built-in standard libraries that could easily satisfy the functionality with the same or even better (?) efficiency? What does mapapp do? What is its type? At first I thought maybe you were rewriting concatMap, but now I can't tell what you're doing. http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-List.htm l#v%3AconcatMap Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Library function for map+append
mapapp _ [] ap = ap mapapp f (a:as) ap = f a : map f as ap What does mapapp do? What is its type? Never mind, I've got it now. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] RE: DDC compiler and effects;better than Haskell?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Pavel Perikov unless you have some insanely clever refactoring tool ready that can convert pure into monadic functions and vice versa. Not trying to attack the idea, just some thoughts: I don't see much problem converting pure function into an effectfull form :) Having pure function myPureFunction::a1-a2-a3-res myPureFunction a1 a2 a3 -- pure call myPureFunction $ a1 * a2 * a3 -- call using Applicative Probably, introducing some conventions and using some language extensions you can write a function taking pure function and converting it into monadic version (a-la SPJ' work on polyvariadic composition etc [1]) Have monadic function but needs to call it from pure code? use Control.Monad.Identity. Not a big deal to me but maybe I'm missing the point In the HaRe catalogue ( http://www.cs.kent.ac.uk/projects/refactor-fp/catalogue/ ) there exists a Monadification refactoring: http://www.cs.kent.ac.uk/projects/refactor-fp/catalogue/Monadification1. html Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Haskell and symbolic references
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Is it possible with Haskell to call a function whose name is contained in a String? Something like: five = call_func add [2, 3] If not, perhaps this is acheivable using FFI? Dynamic loading via plugins will do this. It was broken on Windows for some time; not sure if it works there now. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/plugins Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: GHCi's search path
From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-users-boun...@haskell.org] On Behalf Of Peter Gammie http://haskell.cs.yale.edu/ghc/docs/latest/html/users_guide/se parate-compilation.html#search-path GHCi is not overly keen to go looking for modules in directories different to where the source resides. The semantics I want is: - use the Cabal-built objects/hi files in dist/build if they're fresh enough - interpret the source otherwise. Is that possible? I think the -odir and -hidir options will help e.g. -odir dist/build -hidir dist/build http://haskell.cs.yale.edu/ghc/docs/latest/html/users_guide/separate-com pilation.html#options-output Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: 6.10.3 plans
From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-users-boun...@haskell.org] On Behalf Of Alexander Dunlap An exception to this rule is that we will probably also rebundle time in the bindists, as that has little chance of breaking anything else. Would this be a good time to add the time package too, or has that issue been resolved? I think Ian said time will be rebundled (see excerpt above). Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: [Haskell-cafe] Making videos of your project
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Claus Reinke The problem comes when trying to scale down the size to what would fit in a browser window (what a viewer would see, without having to scroll around) - text becomes hard to read (quality, not size) if I scale from 1280x800 to 640x400, and if I try to work in a screen area that fits 640x400 in the first place (so no scaling would be needed), I can't really show anything.. The intended topic is still haskellmode for Vim, updating the old screenshot tour from http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/vim.html so there'd be a gvim window and a browser window (in real life, also a GHCi window, and quite possibly a cygwin window, but lets keep it simple), and the most interesting info is not in graphics, but in the texts, source code, menus, tooltips, ..., Claus Vimeo supports HD video, of a sort. I've not used it, so can't offer any real advice, but anyways... Their compression FAQ (http://vimeo.com/help/compression) suggests they support a resolution of 1280x720, which looks like it might just be enough for you. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Design Patterns by Gamma or equivalent
Because Haskell is not OO, it is functional, I was wondering if there is some kind of analogous design pattern/template type concept that describe commonly used functions that can be factored out in a general sense to provide the same kind of usefulness that Design Patterns do for OOP. Basically I'm asking if there are any kinds of common denominator function compositions that are used again and again to solve problems. If so, what are they called? Not about Haskell, but Peter Norvig has a presentation about patterns in more-or-less functional languages: http://norvig.com/design-patterns/ Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: Sugestion for a Haskell mascot
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Deniz Dogan Python already uses a snake and it reminds me too much of vi and viper-mode etc. If so many people are reluctant towards the sloth, why don't we just go for the narwhal? They're predators, they have built-in swords and they're just bad ass in general. Then of course, there's the downside that there's no connection to the language itself in any way. Something wrong with the Hercules beetle, used on the cover of Real World Haskell? http://book.realworldhaskell.org/ This book is already creating an association between the Hercules beetle and Haskell, so it seems quite reasonable to continue down that path. Isn't that how Perl got its camel? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Haskell Logo Voting will start soon!
The voting system we'll use is the Condorcet Internet Voting System (http://www.cs.cornell.edu/andru/civs.html ). The poll won't be public, but every subscriber to Haskell-Cafe will get a (private) voting ballot by email. I'll supervise the poll and make sure it's started, stopped and all Haskell-Cafe subscribers get a ballot (Simon Marlow provided the email addresses). I'd love to hear about anything that I missed and/or that might influence the voting process in a significant way. (There are probably some people subscribed with multiple addresses, but I'll be using the subscriber list from yesterday, so signing up now with lots of addresses won't get you more ballots ;) I was wondering if you were addressing duplication. I've been subscribed to café for a long time with at least two email addresses (work and home) but I don't think I should be getting two votes. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Haskell Logo Voting will start soon!
I'd love to hear about anything that I missed and/or that might influence the voting process in a significant way. (There are probably some people subscribed with multiple addresses, but I'll be using the subscriber list from yesterday, so signing up now with lots of addresses won't get you more ballots ;) I was wondering if you were addressing duplication. I've been subscribed to café for a long time with at least two email addresses (work and home) but I don't think I should be getting two votes. Given the size of the group, and the extremely high standard of the members when it comes to moral fibre, common sense, intelligense, etc, etc, do we really need to enforce prevention of duplication? Well, that is one possible solution (let it ride). I don't know what the level of email address duplication is, so I don't know the risk. Voting systems generally have to make a lot of effort to be fair, otherwise detractors can reasonably claim that the result is not valid. And as this is somewhat of a bike-shed level decision, you should expect a great deal of interest and passion! Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Manlio Perillo Sent: 02 March 2009 11:01 Eugene Kirpichov ha scritto: I'm not considering the lazy IO approach, as it doesn't involve any form of control over resources. This is not always true. I'm using lazy IO, still having full control over the resources. parse path = withFile path ReadMode parse' where parse' :: Handle - IO (UArr Xxx) parse' handle = do contents - L.hGetContents handle let v = toU $ xxx $ L.lines contents rnf v `seq` return v All the file is consumed, before the result is returned. This only works if the entire file can reasonably fit into memory. If you want to process something really big, then you need some sort of streaming approach, where you only look at a small part of the file (a line, or a block) at a time. And this is where the enumerator-iteratee approach looks better, because the IO is strict, but you still take a stream-like approach to processing the contents. BTW, does this discussion remind anyone (else) of Peter Simon's Block-IO proposal? http://cryp.to/blockio/fast-io.html Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Duncan Coutts This can still be done using withFile and hGetContents. You just have to put the consumer inside the scope of withFile. The consumer can work in a streaming fashion. With lazy bytestrings this can be both efficient, work in constant memory and guarantee the file is closed. We guarantee the file is closed by using withFile. The only thing to watch out for is a consumer that doesn't consume as much as you were expecting before the file does get closed. You should notice that pretty quickly though since it should happen every time (whereas resource leaks are not so immediately visible). Sure. But this case is the one that typically causes problems for beginners, who have not yet had the educating experience of being bitten by lazy IO. The standard café response to why do I get handle closed errors here? is you're using hGetContents and you haven't forced/consumed all of your file. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] seg-fault in mersenne-random with SSE2 (was Performance question)
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Roel van Dijk I replaced the standard random number generated with the one from mersenne-random. On my system this makes the resulting program about 14 times faster than the original. I also made a change to accumulateHit because it doesn't need to count to total. That is already known. I tried this too, but got a seg fault (!), so I stripped it back to a small test program. This is with mersenne-random, setup configured with -fuse_sse2: module Main (main) where import System.Random.Mersenne import System (getArgs) rands :: Int - IO [Double] rands samples = do rng - getStdGen rns - randoms rng return (take (2*samples) rns) main = do args - getArgs let samples = read (head args) randomNumbers - rands samples print randomNumbers On WinXp with ghc-6.10.1 it always seg faults. If I rebuild without -fuse-sse2 then it's happy. I'm assuming that my machine has SSE2; it's a little old, but it's a P4 (3GHz), so I think it should. Is there an easy way to tell? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Haskell.org GSoC
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Don Stewart You mean, everyone should be able to mess about with my documentation? This would be similar to give everyone commit rights to my repositories or allow everyone to edit the code of my published libraries. What is the good thing about that? No one said anything about unrestricted commit rights ... we're not crazy ... what if it were more like, say, RWH's wiki .. where comments go to editors to incorporate ... Yes. PostgreSQL online docs have a similar feature, although their implementation isn't perhaps as nice as RWH's (I like RWH's inline comments feature). See e.g. http://www.postgresql.org/docs/8.3/interactive/tutorial-createdb.html http://www.postgresql.org/docs/8.3/interactive/functions-string.html http://www.postgresql.org/docs/8.3/interactive/indexes-multicolumn.html http://www.postgresql.org/docs/8.3/interactive/textsearch-tables.html Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Data.List.sort, not so good?
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Adrian Neumann I don't consider myself to be a very advanced Haskell programmer, but I could come up with a Mergesort that beats List.sort, time- and spacewise. http://hpaste.org/13403 On my machine List.sort takes ~10 sec, mergeSort 7, qs 4 (compiled with -O2). List.sort eats too much ram to sort 20.000.000 ints, my algorithms don't. QuickCheck says my implementations are correct. Your single module might be benefiting from optimisation; specifically, specialisation to Ints, which would allow the dictionary lookup to be removed. Can you get the same performance if you move your mergeSort qs functions into a separate module, and only export mergeSort qs? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Problems Installing Takusen with Sqlite Backend
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Günther Schmidt what does it take to install Takusen on Win32 with Sqlite backend? I did manage to install *plain* Takusen via cabal install by downgrading to Cabal-1.4 but when I want to cabal-install takusen -fsqlite it complains about a missing sqlite3. Setup.hs tries to find the location of your sqlite installation by looking for sqlite3.exe, so you need this (and sqlite.dll) in your path. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: Threads with high CPU usage
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Günther Schmidt I understand that Takusen does not use unsafe calls and would like to try it with that one then, but haven't find enough docs yet on how to use Takusen. Not a lot of detailed examples exist for Takusen. I'm hoping the documentation for Database.Enumerator is a reasonable place to start. http://darcs.haskell.org/takusen/doc/html/Database-Enumerator.html I just reviewed the Takusen code and, for no apparent reason, the ODBC module specifies unsafe for all of its FFI imports, but the other modules do not (so they get the default, which I assume is safe). I also was not aware of unsafe calls blocking other threads. I'll change the ODBC imports to be safe (or rather, unspecified). Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] sort and lazyness (?)
Currently, I'm experiencing what I would call strange behaviour: I've got a data-type data Fraction = Fraction Int Int to hold rational numbers (maybe there's already some built-in type for this in Haskell, http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Ratio.html This list has up to 3 million elements. If I do main = print $ length $ points main = print $ length $ map (\(x, _) - x == Fraction 1 2) points main = print $ length $ reverse points However, trying to do import List main = print $ length $ sort points makes memory usage go up and the program does not finish in 15m, also spending most time waiting for swapped out memory. What am I doing wrong, why is sort this expensive in this case? I would assume that computing and holding the whole list does not take too much memory, given its size and data type; doing the very same calculation in C should be straight forward. And sort should be O(n * log n) for time and also not much more expensive in memory, right? Not having looked at your code, I think you are benefiting from fusion/deforestation in the first three main functions. In this case, although you may appear to be evaluating the entire list, in fact the list elements can be discarded as they are generated, so functions like length and reverse can run using constant space, rather than O(n) space. The sort function, however, requires that the entire list is retained, hence greater memory usage. I also think you are optimistic in the memory requirements of your 3 million element list. A list of Ints will take a lot more than 4 bytes per element (on 32-bit machines) because there's overhead for the list pointers, plus possibly the boxes for the Ints themselves. I think there are 3 machine words for each list entry (pointer to this element, pointer to next element, info-table pointer), and 2 words for each Int, but I'm just guessing: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/HeapObje cts You might get some mileage by suggesting to GHC that your Fraction type is strict e.g. data Fraction = Fraction !Int !Int which might persuade it to unbox the Ints, giving some space savings. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Logos of Other Languages
Am 19.12.2008 um 11:43 schrieb Paulo Tanimoto: * an insect or animal: don't know which one, and I assume that beetle in the new book is trademarked by O'Reilly. Maybe something like FalconNL's Monica Monad, but a little more serious. Just as an idea: http://en.wikipedia.org/wiki/Sloth These animals are very lazy and very cool ;-) Can you trademark a picture of a beetle? I would think that, if the book becomes sufficiently popular, that the beetle will become the associated animal (is that how Perl's camel became its icon?). I'd like to know what the relationship is between the O'Reilly camel and the Perl camel - was the Perl Foundation or perl.org given permission to use the camel? That said, I also like the sloth. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: sort and lazyness (?)
How does reverse work in constant space? At the moment I can't imagine it doing so; that's why I tried it, but of course you could be right. It allocates a new list cell for every cell it finds in the input list. If the input list can be garbage collected then reverse takes constant space because each time it inspects a list cell from the input list that cell can be garbage collected. If the input list is being retained for some other reason then reverse will take linear space. I don't think that's true. It must inspect the whole input list to give the first element of the output list, but it cannot garbage collect the input list because it needs to yield every element of it. reverse creates the output list by pulling items from the head of the input list, and prefixing them to the output list. After each item has been pulled from the input, the list node can be GC'd from the input list. Also, if the output list is itself being consumed by a function which does not require the entire list (like length) then again the list node can be GC'd soon after consumption. ghci length $ reverse [1..10^7] This is a compiler optimisation, I think, so will probably require ghc -O(2?). Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: sort and lazyness (?)
reverse creates the output list by pulling items from the head of the input list, and prefixing them to the output list. Tail recursively! That is a very important point. Let's have a closer look at an explicitly recursive version. reverse xs = go [] xs where go out [] = out go out (x:xs) = go (x:out) xs Now let's do a rewrite chain: reverse (enumFromTo 1 4) go [] (enumFromTo 1 4) go [] (1:enumFromTo 2 4) go (1:[]) (enumFromTo 2 4) go (1:[]) (2:enumFromTo 3 4) go (2:1:[]) (enumFromTo 3 4) go (2:1:[]) (3:enumFromTo 4 4) go (3:2:1:[]) (enumFromTo 4 4) go (3:2:1:[]) (4:enumFromTo 5 4) go (4:3:2:1:[]) (enumFromTo 5 4) go (4:3:2:1:[]) [] 4:3:2:1:[] (For sanity I skipped the number evaluation steps, but enumFromTo would have been forcing them to check for the end, so it ends up the same) We needed to construct the entire reversed list before we could see the first cons cell. There is a very strange implementation of reverse whose spine is as lazy as the input spine (but forcing the first element will still force the whole input spine). But it is quite odd, and certainly is not arrived at by the compiler automatically from the definition in the Prelude. I verified with -O2. length . reverse is not constant space in GHC. And there really is no reasonable way it could be (save for specific RULES pragmata). Luke One could also well imagine a list fusion optimisation that says: length . reverse == length I have no idea if this is applied (or even correct). I compared (with ghc 6.8, --make -O2 -prof -auto-all): main = print (length x) x :: [Int] x = [1..100] total alloc = 40,002,288 bytes (excludes profiling overheads) main = print (length (reverse x)) x :: [Int] x = [1..100] total alloc = 52,002,296 bytes (excludes profiling overheads) So the reverse has some overhead (25%). Is that what you'd expect if it was entirely constructed? Another comparison: main = print (length x) x :: [Int] x = take 100 (repeat 1) total alloc = 24,002,256 bytes (excludes profiling overheads) main = print (length (reverse x)) x :: [Int] x = take 100 (repeat 1) total alloc = 36,002,264 bytes (excludes profiling overheads) I'm not sure what this says, exactly (50% overhead?). Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] OT: representations for graphs
(OT, but I'm hoping some of you might have some ideas on this anyway...) I was wondering what alternative representations there are for graphs, or maybe if there might be a way to derive one/some from some insightful observations. For the purposes of storing and exmaining (querying) graphs in an SQL database. For example, a tree (so, a specialised sub-class of graph) can be represented by a three models, that I know of: - adjacency-list (the most common) - materialised-path (a denormalisation of adjacency-list) - nested-sets Nested-sets (and materialised-path) works for trees because the graph is - directed (so we know which nodes are parents or children) - acyclic (there's a definite root, and leaves) - every child has a single parent (so no diamond shapes - does this property have a name?) Nested-sets works well with SQL databases for querying, at the expense of updates. Adjacency-list is easier to update, but some queries suck, or are downright impossible in normal SQL. We can use the adjacency-list model for graphs too, but it has the same query deficiencies as for trees. I'd like some sort of alternative to adjacency-list, like nested-sets, that would work better for querying at the expense of updates. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Sugestion for a basic Utf8 type.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mauricio I would like to sugest a new basic type in Haskell. What if we had something like this (with any other quoting character): «Je ne parle pas français. Meu nome é Maurício. ¿Hablas español?» This would be of type Utf8. I think now it is not a bad idea, since Haskell source code is supposed to be utf-8. The internal representation of this datatype would be a null terminated utf-8 byte vector. ... Stream fusion on Haskell Unicode strings - Tom Harper http://www.wellquite.org/non-blog/AngloHaskell2008/tom%20harper.pdf I don't know what it's status is. The original implementation used UTF16 rather than UTF8. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: breakage with Cabal-1.6
* Takusen-0.8.3 Imports writeHookedBuildInfo from Distribution.PackageDescription While the fix for these three packages' Setup scripts is trivial, there is not fix that will make them compile with old and new versions of the lib. For Takusen I'd be happy to fix the Setup and require the latest Cabal in order to build. That's what we've done in the past. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: Re[2]: [Haskell-cafe] Pure hashtable library
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Davie Much better efficiency in what way? instead of going through many levels of tree/trie, lookup function will just select array element by hash value and look through a few elements in assoc list: data HT a b = HT (a-Int) -- hash function (Array Int [(a,b)]) HT.lookup (HT hash arr) a = List.lookup (arr!hash a) a Which makes two assumptions. One is that your array is big enough (believable), and the other, that your font is big enough. ... and the other, that your font is big enough. Que? This is lost on me. Care to explain? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Haskell garbage collector notes?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Galchin, Vasili Is http://hackage.haskell.org/trac/ghc/wiki/GarbageCollectorNotes a reliable source of info on the ghc garbage collector? Depends which version of GHC... the next release (6.10) will include the new parallel GC: http://research.microsoft.com/~simonpj/papers/parallel-gc/index.htm http://hackage.haskell.org/trac/ghc/wiki/Status/Releases Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: [Haskell-cafe] Haskell garbage collector notes?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Galchin, Vasili Is http://hackage.haskell.org/trac/ghc/wiki/GarbageCollectorNotes a reliable source of info on the ghc garbage collector? Depends which version of GHC... the next release (6.10) will include the new parallel GC: http://research.microsoft.com/~simonpj/papers/parallel-gc/index.htm http://hackage.haskell.org/trac/ghc/wiki/Status/Releases Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] FFI and struct arguments
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Duncan Coutts Sent: 17 July 2008 12:46 On Wed, 2008-07-16 at 22:45 -0300, Felipe Lessa wrote: Hi, I tried googling and searching the haskellwiki about this but wasn't lucky enough. My question is: is there a way to send struct arguments to C functions via the FFI or do I need to create a C wrapper? I guess there isn't, and while I can live without it, I'd like to leave no doubt. If the struct is passed by reference of course then you're fine, but if it's by value then you need a C wrapper. The reason is because it's beyond the scope of the FFI to know the structure layout and how to map that to haskell types. That's the domain of FFI pre-processors. However I don't know of any FFI pre-processors that help in this case. Passing C structs by value seems to be pretty rare in exported C APIs. hsc2hs can help a bit (I haven't used the other FFI tools, so don't take this as an endorsement of hsc2hs over them). You could create a wrapper that marshals your Vector to a vector struct like this: .hsc file: #include vect.h -- whatever header contains your C vector struct data VectorC = Ptr () -- opaque data type, like void* -- your Haskell vector data Vector = Vector Float Float vector2cvect :: Vector - IO VectorC vector2cvect (Vector x y) = do ptr - mallocBytes #{size vect} pokeByteOff #{offset vect, x} x pokeByteOff #{offset vect, x} x return ptr cvect2Vector :: VectorC - IO Vector cvect2Vector ptr = do x - peekByteOff ptr #{offset vect, x} y - peekByteOff ptr #{offset vect, y} return (Vector x y) -- inline your *vect-vect wrapper (ends up in generated .c file) #def void funcWrapper(vect *v) { func(*v); } foreign import stdcall funcWr unsafe funcWrapper :: VectorC - IO () main = do vc - vector2cvect (Vector 3 4) funcWr vc free vc * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell] Re: on starting Haskell-Edu, a new education-related Haskell-related mailing list
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Benjamin L.Russell The only issue is the name of the new list, though: it would seem a better idea to keep the name mnemonic and short, with the suffix following Haskell- within three or four characters. Typing [EMAIL PROTECTED] seems a bit of a hassle; [EMAIL PROTECTED] seems much better. (as I approach the bike-shed, paint-tin and brush ready...) Is there a requirement that the name be prefixed with haskell-? We have [EMAIL PROTECTED], gui@, libraries@, etc. So why not just [EMAIL PROTECTED], [EMAIL PROTECTED], or [EMAIL PROTECTED] Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
RE: [Haskell-cafe] Question concerning datatype Either
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of phy51km4n Why does that not work? : fromTuple (One a) = a fromTuple (Two a b) = (a, b) fromTuple (Three a b c) = (a, b, c) fromTuple (Four a b c d) = (a, b, c, d) Have you tried it? What are the types of the various cases in fromTuple (you can rename them to get ghci to accept them as separate functions): fromTuple1 :: Tuple a b c d - a fromTuple1 (One a) = a fromTuple2 :: Tuple a b c d - ??? fromTuple2 (Two a b) = (a, b) Why is this correct? : fromTuple (One a ) = Left (Left a) fromTuple (Two a b )= Left (Right (a,b)) fromTuple (Three a b c ) = Right (Left (a,b,c)) fromTuple (Four a b c d) = Right (Right (a,b,c,d)) Again, what is the type of just this line? fromTuple (One a ) = Left (Left a) and this line? fromTuple (Two a b )= Left (Right (a,b)) And if you combine them? fromTuple :: Tuple a b c d - ??? fromTuple (One a ) = Left (Left a) fromTuple (Two a b )= Left (Right (a,b)) (You should see that Either's type parameters are progressively filled-in as you add more cases.) Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Access to Oracle database from Haskell
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Henning Thielemann I don't get an error. sqlplus is in $ORACLE_HOME/bin, but the RPM package also sets a link from /usr/bin/sqlplus to $ORACLE_HOME/bin, thus 'sqlplus' is in the $PATH also without $ORACLE_HOME. (But sqlplus cannot be started until the LD_LIBRARY_PATH is extended to Oracles libraries.) Ahhh... so Setup.hs thinks sqlplus is in /usr/bin, rather than $ORACLE_HOME/bin. That explains: include-dirs: /usr/oci I'll have to change the way that Setup.hs tries to find $ORACLE_HOME. Using getEnv would be a much better idea. I don't recall why I didn't use it before; perhaps it's not always set on Windows installations. Your $ORACLE_HOME installation looks fairly normal, if somewhat minimal. I would normally expect to see sqlplus, and maybe some other executables, like tnsping. And a folder $ORACLE_HOME/oci/include, which contains the OCI header files. They got installed to: /usr/include/oracle/10.2.0.4/client/ That is, they are not in $ORACLE_HOME. :-( I'm not sure how Setup.hs would find out where these are installed. Any ideas? It may not matter, as I think you can compile without them. I'd expect problems if you compile -fvia-C, though. $ runhaskell Setup.hs configure --user -f oracle Configuring Takusen-0.8.2... Here, I would expect to see Using Oracle: /usr/lib/oracle/10.2.0.4/client It does not tell me. :-( That is odd. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] expected vs inferred type confusion
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Howard the error: renao.hs:6:4: Couldn't match `HttpResponse' against `IO HttpResponse' Expected type: IO HttpResponse Inferred type: IO (IO HttpResponse) In the expression: return $ (handler session request) In the result of a 'do' expression: return $ (handler session request) the code: import HttpMessage import HttpSession resourceHandler :: HttpSession - HttpRequest - IO HttpResponse resourceHandler session request = do return $ handler session request where handler = which_handler request which_handler r = case request_method r of Get- get_resources Head - last_modified Post - update_resources Put- create_resources Delete - delete_resources get_resources :: HttpSession - HttpRequest - IO HttpResponse get_resources session request = undefined -- ... the same stubbed definition for the other handlers (last_modified, etc) Try removing the do ... return $ e.g. resourceHandler session request = handler session request where Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Announce: Fortress talk in New York City
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Henning Thielemann There will be a talk on Fortress... --- This e-mail may contain confidential and/or privileged information. You send potentially confidential information to a public mailing list? I realise this is tongue-in-cheek... Is this new language secret? :-) .. but I'm not so sure about this. If this is a serious question, here are some links: http://research.sun.com/projects/plrg/ http://research.sun.com/projects/plrg/Publications/index.html http://projectfortress.sun.com/Projects/Community BTW, check out the crappy auto-appended disclaimer (over which I have no control) on this message. Makes Jeff's look positively appealing. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] RealFloat constraint on Complex type
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard A. O'Keefe On 21 May 2008, at 9:25 am, Conal Elliott wrote: I think the practice of constraint in type definitions is generally discouraged, Is this true? If so, why? If I have a data type that simply doesn't make sense unless some of the type variables belong to certain classes, _shouldn't_ that be stated clearly in the declaration rather than hidden elsewhere? I recall this from Graham Klyne, but I think his use case might be a bit different: http://www.ninebynine.org/Software/Learning-Haskell-Notes.html#type-clas ses-and-data I don't know all the pros and cons (are there pros, other than the documentation argument you gave?). I think: 1. adding the constraint has some costs, and very few benefits 2. nobody does it much, if at all. Probably for the first reason. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Starting Haskell with a web application
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johan Tibell I'm writing a web application server which I'm trying to make as simple to manage as Mongrel [1], a popular Ruby web server used to host web application written in e.g. Ruby on Rails. It uses Oleg style enumerators and ByteString internally to safely an efficiently manage resources. The web application interface is that of Python's WSGI [2] but adapted to a Haskell style. I've been busy lately but starting this weekend I will have much more time to work on it and can hopefully make a first release. 1. http://mongrel.rubyforge.org/ - I believe the original author left the project so the projects original website is gone. 2. http://www.python.org/dev/peps/pep-0333/ Do you (both) have repos that I could download from? I quite interested in both projects, esp. the WSGI clone. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: ghc-6.8.1 on WinXP: windres: can't open font file `for'
From: Simon Marlow [mailto:[EMAIL PROTECTED] c:\ghc\ghc-6.8.1\bin/windres: can't open font file `for': No such file or directory This one was fixed in 6.8.2. Bummer. I was hoping to be able to use 6.8.1 with gtk2hs (AFAIUI, gtk2hs doesn't work with/hasn't been compiled against 6.8.2 yet). Is there a workaround or something I can tweak in my 6.8.1 installation? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: ghc-6.8.1 on WinXP: windres: can't open font file `for'
From: Neil Mitchell [mailto:[EMAIL PROTECTED] Bummer. I was hoping to be able to use 6.8.1 with gtk2hs (AFAIUI, gtk2hs doesn't work with/hasn't been compiled against 6.8.2 yet). Is there a workaround or something I can tweak in my 6.8.1 installation? It's much easier to gently prod Duncan until he gives in and releases a new gtk2hs version. Maybe... the fact that I don't have this problem with 6.8.1 on my laptop implies that there *might* be something external to ghc that I can change that would fix it. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
ghc-6.8.1 on WinXP: windres: can't open font file `for'
I've just installed ghc-6.8.1 on my WinXP workstation (I already have it successfully working on my laptop). When I compile anything, the linking stage fails with: c:\ghc\ghc-6.8.1\bin/windres: can't open font file `for': No such file or directory Any clues as to what's wrong? Google isn't very helpful... (I've stripped my path back to just windows, windows\system32, and ghc, but no joy). Alistair P.S. output from ghc -v3 (trimmed): Linking Main.exe ... *** Windres: c:\ghc\ghc-6.8.1\bin/windres --preprocessor=c:\ghc\ghc-6.8.1\gcc -Bc:\ghc\ghc-6.8.1\gcc-lib/ -E -xc -DRC_INVOKED --input=C:/DOCUME~1/bayleya/LOCALS~1/Temp/ghc1480_0/ghc1480_0.rc --output=C:/DOCUME~1/bayleya/LOCALS~1/Temp/ghc1480_0/ghc1480_0.o --output-format=coff c:\ghc\ghc-6.8.1\bin/windres: can't open font file `for': No such file or directory The .rc file it is given contains: 1 24 MOVEABLE PURE Main.exe.manifest so this ... font file 'for':... message is a puzzle. * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] RE: [Haskell] Announce: Yi 0.3
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Philippe Bernardy * homepage: http://haskell.org/haskellwiki/Yi Took a quick look around and saw this: * GTK frontend works in Win32 So Yi works on Windows? hs-plugins was broken for Windows for a while, so I'm wondering if this has been fixed too. Does Yi use hs-plugins, or does it go straight down to ghc? (looking at the yi.cabal file seems to indicate no dependency on hs-plugins) Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] RE: [Haskell] Announce: Yi 0.3
From: Thomas Schilling [mailto:[EMAIL PROTECTED] So Yi works on Windows? hs-plugins was broken for Windows for a while, so I'm wondering if this has been fixed too. Does Yi use hs-plugins, or does it go straight down to ghc? (looking at the yi.cabal file seems to indicate no dependency on hs-plugins) Correct. Does that mean you volunteer and report any problems of running Yi on Windows? ;-) I'd love to, but JP has just indicated (privately) that it's broken on Windows, for other reasons. I was trying to establish whether it was worth my time to attempt to download Yi and GTK2HS and build them. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Simple network client
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Verswyvelen As a newbie I made a nice little program that called readFile and writeFile on the same filename, but of course the file handle of the readFile was not closed yet = access denied. A nice case of getting bitten by my imperative background. So I guess hGet/hGetNonBlocking/ByteString is also the correct way to solve this? More than one person has posted previously about the flaws and traps of lazy IO. A common position seems to be don't do lazy IO. http://article.gmane.org/gmane.comp.lang.haskell.cafe/20106/ Peter Simons has this library: http://cryp.to/blockio/ BTW, where's the tutorial that Peter wrote? http://article.gmane.org/gmane.comp.lang.haskell.cafe/4011/ And there are other IO libraries out there. Bulat has done a lot of work on stream IO, I recall. PS: I would love to see an immutable filesystem that does not allow writing to files, it only creates new files and garbage collects files that have no incoming reference anymore... Just like a garbage collected heap, and a bit like an OLAP databases (as far as I remember my DB theory...) Besides the performance bottleneck, does something like that exists? This might interest you: http://okmij.org/ftp/Computation/Continuations.html#zipper-fs Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
code.haskell.org vs darcs.haskell.org (was [Haskell-cafe] Enterprise Haskell AMQP library)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Don Stewart So you visit: community.haskell.org And submit your ssh public key, to allow you to log into code.haskell.org At the same time you can ask for a project account, which will give you space for a repository on the machine. You can see other projects here: code.haskell.org -- Don I'm wondering what the relationship is (if any) between code.haskell.org and darcs.haskell.org. A bunch o' questions: - should my project(s) be hosted at darcs or code ? - is one more blessed/preferred over the other for community projects? - if my project is currently on darcs, should I migrate to code? - if I have an account on darcs, will it work on code, or do I need to get a new account on code? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: OOP'er with (hopefully) trivial questions.....
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nicholls, Mark The open case (as in OO) seems to be more like the Haskell class construct, i.e. if new types declare themselves to be members of a class then they must satisfy certain constaintsI can then specify equals with the class and leave the onus on the implementor to implement itthe data construct seems more analogous to a OO class definition...which is closed in the same way. This may or may not help, but anyway... As Henning has pointed out, this is a FAQ. However, his recommended page (OOP_vs_type_classes) is quite involved. As a counterpoint, I really liked Lennart's example and summary from a couple of years ago: http://www.haskell.org/pipermail/haskell/2005-June/016058.html (I've added it to section 5 of this page: http://www.haskell.org/haskellwiki/Existential_type) The key point (IMO): with the object oriented way it's easier to add a new kind of shape and with the functional way it's easier to add a new operation. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] data vs newtype (was: OOP'er with (hopefully) trivial questions)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nicholls, Mark To recap... type introduces a synonym for another type, no new type is createdit's for readabilities sake. Newtype introduces an isomorphic copy of an existing type...but doesn't copy it's type class membership...the types are disjoint/distinct but isomorphic (thus only 1 constructor param). data introduces a new type, and defines a composition of existing types to create a new one based on - and (. class introduces a constraint that any types declaring themselves to be a member of this class...that functions must exist to satisfy the constraint. As an aside, I was wondering exactly what the differences are between newtype and data i.e. between newtype A a = A a and data A a = A a According to: http://www.haskell.org/onlinereport/decls.html#sect4.2.3 newtype is, umm, stricter than data i.e. newtype A undefined = undefined, but data A undefined = A undefined. Other than that, newtype just seems to be an optimization hint. Is that a more-or-less correct interpretation? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] RE: data vs newtype (was: OOP'er with (hopefully) trivial questions)
From: Bayley, Alistair newtype A a = A a and data A a = A a Sorry, that should read: newtype A = A a data A = A a * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] RE: data vs newtype (was: OOP'er with (hopefully)trivial questions)
From: Bayley, Alistair Sorry, that should read: newtype A = A a data A = A a Ignore that; I was right first time. Sorry 'bout the spam, and the lack of brain. * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: upgrading visual studio integration to use 6.8.2....
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seth Kurtzberg Wouldn't an eclipse plug in make more sense? (Unless one exists that I'm unaware of.) http://eclipsefp.sourceforge.net/ Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: [Haskell-cafe] New slogan for haskell.org
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Derek Elkins (Not directed at gwern in particular) I have a better idea. Let's decide to do nothing. The benefits of this approach are: 1) it takes zero effort to implement, 2) the number of people who immediately give up on Haskell from reading that is, I suspect, neglible (actually I suspect it is zero; I think the number of people who actually read that at all is probably negligible), and 3) it accomplishes the same end as debating endlessly while creating much less list traffic. Should we set up a haskell-marketing mailing list for people who still have some passion (or merely stamina) for the discussion? Or is there a lighter-weight way to take the discussion off-list/to another list? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] building HUnit and other packages on Windows cygwin...
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Galchin Vasili I believe that HUnit has absolutely not other package dependencies. When I do a runhaskell Setup.hs build, I get the following error message: gcc: installation problem, cannot exec `cc1': No such file or directory. I am not sure what cc1 is? A pass/phase of the gnu gcc compiler? Which version of ghc is it? There's a bug with ghc-6.8.1 and Cabal, where you need to put gcc-lib in your path. It looks like that solution might help you here, but I don't know what the cause of the problem is. Yes, cc1 is the gnu c compiler, which is bundled with ghc in the gcc-lib folder. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] cabal under windows (was Re: Haskell-CafeDigest, Vol 51, Issue 180)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Duncan Coutts On Thu, 2007-11-29 at 13:51 +1100, Tim Docker wrote: Is it actually reasonable to expect any cabal packages that depend on external c libraries and headers to build out of the box on windows? How can cabal find out where those files are, without requiring a config file to be edited? It's usually worse than that. The most likely situation is that the C library and header files are not even installed. This is a big problem for all packages that wrap C libs. It can be done, with a bit of work, luck, and a brittle cabal Setup.hs :-) If you assume that the user has installed the 3rd party library correctly, and you know it's layout and an executable it uses (which is on the PATH), then you can do something like what HSQL does (and Takusen now, which copied HSQL's approach). That is, you ask for the location of the known executable in the PATH, and then build your header (include) and library paths relative to the location of the executable. That's what we've done in Takusen for the Oracle and Sqlite installations. For PostgreSQL there is a program you can run which will emit the installed locations of the include and library files, so that's slightly less brittle. Of course, if the particular libs are not on the PATH then this won't work :-( Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Dynamically find out instances of classes (pluginsystem for haskell)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Radoslaw Grzanka Hi, Is there any plugin system for haskell? For example, in Java, I can load all compiled classes from given directory, check their interfaces and run some methods through reflection etc. Is it possible in haskell, to load modules from given directory, and if in module there is instance of class then return instantiation of that class? There are two libs that I'm aware of. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/plugins-1.0 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/metaplug-0.1. 1 AFAICT, plugins is more mature and has a higher-level API, but the last time I looked it was not working on Windows under ghc = 6.6 (can anyone refute or verify this?) It's more like dynamic linking than Java's reflection: you have to already know what functions are in the module (and their types) to be able to call them. I'm not sure about directly creating values of data types exported from the module. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] expanded standard lib
| the php documentation has user contributed notes | http://www.php.net/manual/en/introduction.php | I think this is a very nice feature. * Hardest of all: evolution. Both GHC's user manual and library docs change every release. Even material that doesn't change can get moved (e.g. section reorganisation). We don't want to simply discard all user notes! Just for comparison: PostgreSQL's site has a similar feature (http://www.postgresql.org/docs/manuals/). However, they don't appear to migrate user notes between documentation versions e.g. these pages from 8.1 have comments: http://www.postgresql.org/docs/8.1/interactive/rules.html http://www.postgresql.org/docs/8.1/interactive/user-manag.html the equivalent pages from 8.0 have no/different comments: http://www.postgresql.org/docs/8.0/interactive/rules.html http://www.postgresql.org/docs/8.0/interactive/user-manag.html So that could be a starting point, but it does seem a bit unsatisfactory. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Fwd: Trouble using HDBC-postgres on Windows - can'tfind libpq.dll
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Justin Bailey Well, I answered my own question. Unlike UNIX, specifying a library without the leading lib causes the library to not be found. Not sure if that's a GHC linking problem or what. Changing the library requirement to libpq in the .cabal file did the trick tho. This seems to be a bit different from what I discovered when cabalising Takusen. ghc uses gnu ld, which seems to be smart enough to know that -lpq means find libpq.dll or pq.dll. ghci's linker/loader isn't so slick. If you say -lpq to ghci, it looks for pq.dll only. So I just copied libpq.dll to pq.dll, so that they both exist. You're using runghc, so I guess that must use ghci, or something equivalent. You may find, now that you've changed the cabal entry to libpq, that you can no longer build with ghc (the compiler). But my memory of this is hazy. I think it's better to stick with pq in the cabal file (and copy libpq.dll to pq.dll), because this works for Unix systems too. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Type error with simple list function
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of This simple function definition that should rotate a list (put the first item in the last place) fails with a rather cryptic error with ghc: f :: [a] -[a] -[a] f (w : ws) = ws : w Couldn't match expected type `[a] - [a]' against inferred type `[[a]]' In the expression: ws : w In the definition of `f': f (w : ws) = ws : w Well, there are a few problems. First, you've given a type sig which suggests that f takes two arguments (both lists of type [a]) and returns a list of type [a]. However, there is only one argument to f. A type sig that better matches your function definition might be f :: [a] - [a] Second, the pattern matching in f (w:ws) matches the first item of the list to w, and the rest of the list to ws. The type of the first item in the list will be a, not [a]. Third, in the body of the function you're trying to join ws, which has type [a], to w, which has type a. The (:) operator (AKA cons) expects arguments of types a and [a] respectively i.e. the other way around from what you have. I suspect you might want a different operator... Hope this helps, Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] WideFinder
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of manu Haskell is conspicuously absent from the languages used to tackle Tim Bray's Wide Finder problem (http://www.tbray.org/ongoing/When/200x/2007/10/30/WF-Results?updated). So far we have Ocaml, Erlang, Python, Ruby, etc... Tim Bray mentions that GHC won't build on Solaris, so presumably that problem would need to be solved before Haskell appears in his table. I see that there are Solaris binary packages: http://www.haskell.org/ghc/download_ghc_661.html#sparcsolaris so perhaps he just needs to be pointed to them? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] type/class question: toString
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Graham Fawcett Is there a way to declare a 'toString' function, such that toString x | x is a String = x toString x | x's type is an instance of Show = show x Perhaps, in the type system, there's a way to declare a ToString class, and somehow inherit all instances of Show as ToString instances? I'm assuming you're not fond of the way the print function handles Strings? With GHC you can do this: {-# OPTIONS -fallow-overlapping-instances #-} {-# OPTIONS -fallow-undecidable-instances #-} class Show a = MyShow a where show_ :: a - String instance MyShow String where show_ s = s instance (Show a) = MyShow a where show_ s = show s Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] RE: [Haskell] Re: Trying to install binary-0.4
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Simon Marlow x changes == API changed x constant but y changes == API extended only x and y constant == API is identical Ordering on versions is lexicographic, given multiple versions that satisfy a dependency Cabal will pick the latest. Just a minor point, but would mind explaining exactly what lexicographic ordering implies? It appears to me that e.g. version 9.3 of a package would be preferred over version 10.0. That strikes me as counter-intuitive. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] RE: [Haskell] Re: Trying to install binary-0.4
From: Simon Marlow [mailto:[EMAIL PROTECTED] The lexicographical ordering would make 10.0 9.3. In general, A.B C.D iff A C or A == C B D. When we say the latest version we mean greatest, implying that version numbers increase with time. Does that help? Sort of. It's what I'd expect from a sensible version comparison. It's just not something I'd ever choose to call lexicographic ordering. IMO, lexicographgic ordering is a basic string comparision so e.g. max 10.0 9.3 = 9.3 I'd call what you're doing numeric ordering. Does it have a better name, like version-number-ordering, or section-number-ordering (e.g. Section 3.2.5, Section 3.2.6)? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] New slogan for haskell.org
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Don Stewart It was raised at CUFP today that while Python has: ... Note its all about how it can help you. The Haskell website has the rather strange motivational text: ... Can't we embrace the power of 'and'? It's wonderful that Haskell is seeing more practical use, but we shouldn't forget the foundations, either. Maybe we should put your second description first, and *then* have a paragraph saying, and, for those who know what these are, polymorphism, monadic effects, etc.? Only describing Haskell in terms of software engineeering doesn't seem right to me. Yes, I think that's the best step. Combine both why you'd use it, with what unique features enable this. Well, wouldn't it be best to define your audience first? At the risk of alienating Pythonistas... The Python home page is very much snake oil (as Albert points out). But it appears that they're aiming squarely at the average gormless C/C++/VB/Java drone who's heard a bit about some exciting dynamic language called python. And I think they do a pretty good job at marketing to this segment: the python.org website is certainly sexier than haskell.org, and the promotional text is in prime position, *in bold*. BTW, the Ruby website ( http://www.ruby-lang.org/en/ ) is quite similar in promotional style, and has an even sexier design. They're making the most of the attention ruby-on-rails has generated. So the question becomes: do you want to attract/seduce this kind of programmer? Let's assume the answer is yes :-) ... Then what sort of language should you use in your promotional paragraph? I don't think polymorphism, monads/monadic effects, higher order functions, and even type classes should be used. These terms will be universally unfamiliar to the target audience, and will alienate them. I agree with Tim that Haskell's sound foundations are great and should be promoted; but perhaps in woolier language? Something to bear in mind is that if your reader does know what higher-order functions, type classes, and monads are, then it is likely that they already have a good idea of what Haskell is. Preaching to the converted. Only describing Haskell in terms of software engineeering doesn't seem right to me. If you assume the same target audience as above, to me it seems right to *only* use software engineeering terms, because they're about the only terms that will be understood. So here are some points I think we could make, in software engineering terms: - more concise, readable code (like other functional languages, such as Erlang, Scheme, Lisp) - sound theoretical foundation (language is well-defined and logical). Code with side-effects is separated from purely functional code. - more reliable (no pointers, static type checking) - static type system superior to Java, C++, and C# - type inference means it doesn't get in your way (I'd like to say something about how the type system can reduce the amount of code you have to write through good design of your data types and classes, but I don't know how...) - excellent integration with existing C code via one of the best FFI's around - excellent support for concurrent and parallel programming (forecasting the impending NDP implementation :-) - compilers generate fast code, in the same ballpark as C/C++ - advanced testing tools like Quickcheck, plus the familiar xUnit clone - general purpose: can be used for servers, web-apps, desktop apps, scripting Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] YI on Windows?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Verswyvelen I retrieved the latest version of YI, but I failed to compile it for Windows (GHC 6.6.1, and I got alex-2.1.0, haddock-0.8, HsColour, GTK, but not VTY) Before even pasting the error log, is it supported in Windows? Yi uses hs-plugins, and, last time I looked, hs-plugins was broken under ghc-6.6 (.1) on Windows. I'm interested in hs-plugins on Windows (XP); does anyone know what it's status is? Is it meant to be working? Does it work for others? Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell] downtime for monk ({darcs, hackage, cvs}.haskell.org) Monday from 3pm UTC
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Lynagh The machine called monk ... will be down from 3pm UTC on Monday 24th for an OS and RAM upgrade. Do you have any estimate for how long the upgrades will take? Thanks, Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
RE: [Haskell-cafe] Developing XPCOM components (Firefox extensions) inHaskell
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pasqualino 'Titto' Assini I wondered if anyone could advice on how to develop XPCOM components in Haskell. I am aware that HDirect supports COM and that there are some similarities with XPCOM but I do not have the time to extend/fix HDirect to support XPCOM. Would using FFI directly be simpler? You might consider Krasimir's hscom lib as a starting point: http://www.mail-archive.com/[EMAIL PROTECTED]/msg19723.html http://darcs.haskell.org/packages/hscom/ I'm not advocating it (I've never used it); just pointing out that it exists. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: Status of GHC runtime dependency on GNU multi precisionarithmetic library
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan O'Rear http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes It's less of an issue on Linux where libgmp is dynamically linked but when thinking about using Haskell ghc for creating Windows apps it is for me a real problem, because it would mean I'd have to distribute the code for my app as a library along with the code as an executable, thus doubling the download size for my apps as well as having to include a license that has to explain to a possibly non-technical user that although the program includes code that is libre/gratis free the program is not itself free etc etc... Huh? AFAIK the LGPL is only an issue for the commercial/proprietary users of Haskell; gratis/libre works would continue to be gratis/libre after linking with GMP. I could be wrong, but I believe that Brian's intention is indeed to release a commercial/proprietary app, hence it is possibly an issue for him. I'm not sure about having to distribute the code for his app; I thought the point of the LGPL license was to allow proprietary (non-GPL?) apps to link to LGPL libs. Wouldn't he just have to distribute the code for GMP? But then, I understand less about FSF licensing than pretty much everyone else on this list, so I'll shut up now... Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: [Haskell-cafe] Dynamic thread management?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hugh Perkins Not many replies on this thread? Am I so wrong that no-one's even telling me? I find it hard to believe that if there were obvious errors in the proposition that anyone would resist pointing them out to me ;-) Well, I vaguely recall a study which analysed a number of programs and determined that there was not a lot of inherent parallelism in them, so the effort to automate parallelism wouldn't have much payoff. Wait a sec... This isn't it, but seems relevant: http://www.detreville.org/papers/Limits.pdf Here you go: http://citeseer.ist.psu.edu/tremblay95impact.html So, that leaves a couple of possibilites: some people are agreeing, but see no point in saying; or noone cares, because we all only have 1 or 2 core machines. Well, the Harris/Singh paper summarises the common problems: - not many programs are inherently parallel - parallelism must be quite coarse to offset overheads (which I think is the problem with expecting things like map and fold to parallelised automagically; they're just too small grained for it to be worthwhile) - lazy evaluation makes it harder Basically, it's harder than it sounds. This is where NDP looks good. Although you have to explicitly label parallel operations, you get to use your functional tools like map and fold, etc. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: FW: RE [Haskell-cafe] Monad Description For Imperative Programmer
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of peterv However, one thing which I find annoying is that a classic pure function cannot evaluate an IO function unless you use unsafePerformIO; one must promote (?demote) the pure function into the IO monad. That's just a property of the IO monad, rather than monads in general: http://www.haskell.org/all_about_monads/html/laws.html#nowayout Any ways of promoting such a pure function into the monadic one automatically? I tried playing with liftM, without succes. This is where Claus plugs HaRe :-) (although liftM + friends is normally what one uses). You might find this relevant: http://www.cs.kent.ac.uk/projects/refactor-fp/catalogue/Monadification1. html Some people (but I'm not sure who) probably write most of their Haskell code in a monadic style, so as to make conversion between various monads less painful. It's still pure... Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Conditional compilation of Setup.hs
I'd like to add a #ifdef to Takusen's Setup.hs, so that we can have a single source file that will compile with ghc-6.6 and ghc-6.6.1. With ghc-6.6 and Cabal-1.1.6.1 we use splitFileName and joinPaths from Distribution.Compat.FilePath. With ghc-6.6.1 (which includes Cabal-1.1.6.2) these have been moved to System.FilePath. I'd like to do something like the following: #ifdef __CABAL_VERSION__ 117 import System.FilePath (splitFileName, combine) joinPaths = combine #else import Distribution.Compat.FilePath (splitFileName, joinPaths) #endif Is something like this possible with Cabal? It's either that, or make Takusen's install depend on filepath. I'm not sure which is the least desirable, but I'm open to suggestions. To be fair, we already require our ghc-6.6 users to upgrade Cabal from 1.1.6 to 1.1.6.1, so making them install filepath instead perhaps isn't so bad, and is no more effort. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Handling custom types in Takusen
I noticed that in Takusen there're just two instances to implement to make any Haskell type db-serializable: DBBind / SqliteBind for serialization and DBType for deserialization. I wanted to implement blob serialization for PackedStrings, but I noticed that both DBBind and DBType classes are not public. Defining custom serialization (not just Show / Read string serialization) is very useful in applicative code, and not just in Takusen backend code. There's any way to do it without modifying Takusen Sqlite backend? Salvatore Insalaco Sorry, not at present. It shouldn't be hard to modify the code though, and PackedString support is something we should really be thinking about anyway (as well as Blobs, which I think should have a different type). Although DBType is a class in InternalEnumerator (so you'd think it might be easy to extend with new types), in practice we do not expose the internal Query and ColumnBuffer objects that you also need to create new instances of the class, so you're stuck with what we provide. This is intentional; you usually need to access the low-level buffers and other resources to write an instance on DBType, and we don't want to expose these details to users. By hiding this stuff, we can ensure that resources are properly cleaned up when queries and commands complete. So, please take this as an invitation to modity the Sqlite implementation to handle PackedStrings (and Blobs, if you want to). BTW, do you really need to marshall PackedStrings to blobs? The Sqlite library uses CStrings, and I assume that CString to PackedString marshaling is fairly efficient, so that would seem to be a better choice. (I have no experience of PackedStrings, so there might be good reasons to prefer blobs, and I'd like to know what they are.) Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Handling custom types in Takusen
From: Salvatore Insalaco [mailto:[EMAIL PROTECTED] The main reason is that I'm working on a Sqlite back-end for Darcs, that will be used to store file contents. I think to choose Takusen as back-end library mainly because it has the blob functions of Sqlite already mapped. Umm, yes... I wrote the blob FFI imports for Sqlite, as I planned to prototype Takusen's blob support in Sqlite first, but never got any further with it. It is completely untested. In Darcs PackedStrings are used to store file contents in memory. I don't think that it would be very efficient to store files of megabytes in a text column (there could be encoding problems too). Also, in Sqlite 3.4, they introduced new functions for incremental reading / writing of Blobs. I could use them in the future. Seems reasonable. I recall Oleg saying something privately a while ago about an API for large objects. He may have some ideas for this. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Handling custom types in Takusen
From: Salvatore Insalaco [mailto:[EMAIL PROTECTED] 2007/7/27, Bayley, Alistair [EMAIL PROTECTED]: Also, in Sqlite 3.4, they introduced new functions for incremental reading / writing of Blobs. I could use them in the future. Seems reasonable. I recall Oleg saying something privately a while ago about an API for large objects. He may have some ideas for this. A good idea could be to do the marshalling / unmarshalling of Blob as CStringLen. It can then be used to construct PackedStrings and ByteStrings in O(1), or doing some custom computations with it. A CStringLen, even if contains Ptr CChar, can easily be converted to any pointer type. Another idea could be using custom bind function for blobs, but the first solution is surely easier. It was my intention to do it the other way around: marshall blob to Ptr (), and then you can cast this to a Ptr CChar. Obviously you'd need to retain the size information, so a blob basically becomes a (Ptr (), Int) pair, just like a CStringLen... At least this way you've got a type which says explicitly this thing is a blob, and then if you know better, i.e. it's really a CString, you can cast it. Actually, it wouldn't cost much to have both marshalling functions in the low-level API, even if they both call the same Sqlite blob retrieval function. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] UTF-16
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Donald Bruce Stewart andrewcoppin: I don't know if anybody cares, but... Today a wrote some trivial code to decode (not encode) UTF-16. I believe somebody out there has a UTF-8 decoder, but I needed UTF-16 as it happens. Perhaps you could polish it up, and provide it in a form suitable for use as a patch to: http://code.haskell.org/utf8-string/ that is, put it in a module: Codec.Binary.UTF16.String and provide the functions: encode :: String - [Word8] decode :: [Word8] - String ? And then submit that as a patch to Eric, the utf8 maintainer. -- Don There is a UTF16 en/decoder in Foreign.C.String (see cWcharsToChars charsToCWchars): http://darcs.haskell.org/libraries/base/Foreign/C/String.hs but it only seems to be available for Windows users, via the CWSTring functions. In Takusen we also have a UTF8 module (it's about the fourth or fifth out there, after HXML and John Meacham's, and someone else's - Graham Klyne?, and one hidden away in GHC's internals). It has pure en/decode functions (String - [Word8]), naturally (which we ripped off from John Meacham), but we were more interested in efficient marshalling from CStrings (or data buffers, if you like), so we wrote specific code to marshall CString - String fairly quickly, and space efficiently (see fromUTF8Ptr, which is wrapped by peekUTF8String{Len}): http://darcs.haskell.org/takusen/Foreign/C/UTF8.hs We stuck it in the Foreign.C namespace, rather than Codec, because we're doing more FFI related stuff. I'm not sure what the best location is; perhaps there should be a split, with FFI functions (withUTF8String, peekUTF8String) in Foreign.C, and pure functions in Codec. (Also, is there a wiki page somewhere which gives advice as to how to locate/name library modules, and what the currently occupied namespace is, including user libs like those on Hackage? It's sometimes a bit tricky to try to figure out where to put a new module.) Obviously a proliferation of UTF8 modules isn't great for code re-use. Is there a plan to consolidate and expose UTF8 and UTF16 de- and encoders in the libraries? I note that the various UTF8 modules have fairly similar implementations, and differ mainly w.r.t. how much of the UTF8 codepoint space they handle (for example, HXML's decodes up to 6 bytes, which isn't strictly standards compliant). Also, some choice as how to handle errors in the byte stream might be nice i.e. the user could choose between functions which raise errors, or introduce substition chars. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] HDBC or HSQL
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Donald Bruce Stewart Does anyone know why Takusen isn't on hackage yet? It appears to be cabalised, and have a tarball: http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Database http://darcs.haskell.org/takusen/ Simply because it's (yet) another thing that neither Oleg nor I have got around to doing, or figuring out how/what to do. (Looking now...) Seems pretty simple. I see there's just one option to cabal's sdist: --snapshot. Can anyone tell me if I should use this or not? Does it matter much? BTW, an ODBC implementation for Takusen is in the pipeline. The latest patches in our darcs repo include some ODBC modules, although they're far from finished. There are still quite a few issues to sort out. After ODBC I think a FreeTDS (http://www.freetds.org/) implementation would be a good idea, as this ought to give native (i.e. not via ODBC) access to both MS Sql Server and Sybase. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] RE: Optimising UTF8-CString - String marshaling, plus comments on withCStringLen/peekCStringLen
From: Simon Marlow [mailto:[EMAIL PROTECTED] http://darcs.haskell.org/takusen/Foreign/C/UTF8.hs In that code you have: | x = 0x0010 -- should be 0x001F I wasn't aware that the largest unicode code point had changed. Do you have a reference? Should we change the range of Char in GHC? No, that's merely a bad comment. I think it was meant to refer to that fact that the UTF8 encoding will permit codepoints up to 0x001F with 4 bytes, so if the decoder was to handle the full UTF8 range (up to 6 bytes) then this test would read: | x = 0x001F Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Optimising UTF8-CString - String marshaling, plus comments on withCStringLen/peekCStringLen
Weird... I sent this over a month ago, and was a bit puzzled as to why it didn't appear on the list. Has it been waiting for a moderator to release? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Bayley Sent: 04 June 2007 09:44 To: haskell-cafe Cc: Duncan Coutts Subject: Re: [Haskell-cafe] Optimising UTF8-CString - String marshaling,plus comments on withCStringLen/peekCStringLen Hello cafe, (Following up on my own optimisation question, and Duncan's advice to look at http://darcs.haskell.org/ghc/compiler/utils/Encoding.hs) If you want to look at some existing optimised UTF8 encoding/decoding code then take a look at the code used in GHC: http://darcs.haskell.org/ghc/compiler/utils/Encoding.hs Duncan I took a look at the UTF8 decoder in GHC. This inspired me to write one that also used unboxed types directly. Pleasingly, it goes like a cut cat, and uses far less space than the naive version, but it's not portable, which is a bummer. ... * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Optimising UTF8-CString - String marshaling, plus comments on withCStringLen/peekCStringLen
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan O'Rear fromUTF8Ptr unboxes fine for me with HEAD and 6.6.1. - the chr function tests that its Int argument is less than 1114111, before constructing the Char. It'd be nice to avoid this test. You want unsafeChr from the (undocumented) GHC.Base module. http://darcs.haskell.org/ghc-6.6/packages/base/GHC/Base.lhs for reference (but don't copy the file, it's already an importable module). odd duplicated simplifier output) ISTR seeing a bug report about this a while back, we know it's dumb. You could probably use x 0xF8 instead. FWIW, I've optimised this to a point where I'm happy with it, and you can see the results here: http://darcs.haskell.org/takusen/Foreign/C/UTF8.hs I was using ghc-6.6 back in June, and an upgrade to 6.6.1 fixed some of the issues for me (e.g. unboxing Ptrs, bang-patterns differ from seq). I sent a test case to Simon PJ about the duplicated code in the simplifier output, but I can't tell if it's been added as a trac ticket. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: haskell for web
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ??? help haskell for web code http://www.haskell.org/haskellwiki/Applications_and_libraries/Web_programming Try a few of these out (whatever meets your needs). For web apps WASH and HAppS seem popular. Feel free to ask the haskell-café list for further help. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users