Re: [Haskell-cafe] hledger subcommand detection, RFC

2011-08-29 Thread Conrad Parker
On 27 August 2011 00:23, Simon Michael si...@joyful.com wrote: Thanks Conrad! Those are some great links. I wrapped up some manpage generation code in a package called ui-command, which is kind of orthogonal to cmdargs (ui-command just deals with subcommands). Example commands are often

Re: [Haskell-cafe] Dynamic loading of module

2011-08-29 Thread Arnaud Bailly
Thanks again for your patience and efforts. I am pretty sure I did not remove anything from the global package scope, at least intentionally. But of course I may have done things whcih you did not recommend. Here is the command-line history: ghc-pgk unregister --user template-haskell ghc-pkg

Re: [Haskell-cafe] Dynamic loading of module

2011-08-29 Thread Arnaud Bailly
Anyway, I will reinstall Haskell platform and read carefully your post to be sure I do not screwed my setup again in the future. Best regards, Arnaud On Mon, Aug 29, 2011 at 8:41 AM, Arnaud Bailly arnaud.oq...@gmail.comwrote: Thanks again for your patience and efforts. I am pretty sure I did

Re: [Haskell-cafe] bitSize

2011-08-29 Thread Andrew Coppin
I meant if you're trying to *implement* serialisation. The Bits class allows you to access bits one by one, but surely you'd want some way to know how many bits you need to keep? I think that falls into the realm of protocol design; if you're doing it in your program at runtime,

Re: [Haskell-cafe] bitSize

2011-08-29 Thread Alexander Kjeldaas
On 27 August 2011 21:57, Brandon Allbery allber...@gmail.com wrote: On Sat, Aug 27, 2011 at 06:57, Andrew Coppin andrewcop...@btinternet.comwrote: On 26/08/2011 10:51 PM, Steve Schafer wrote: On Fri, 26 Aug 2011 20:30:02 +0100, you wrote: You wouldn't want to know how many bits you need

[Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Michael Snoyman
Hi all, Erik just opened an issue on Github[1] that affected me very recently as well when writing some automated Hackage checking code[2]. The issue is that http-enumerator sees the content-encoding header and decompresses the tarball, returning an uncompressed tarfile. I can avoid this with

Re: [Haskell-cafe] bitSize

2011-08-29 Thread Andrew Coppin
On 29/08/2011 09:00 AM, Brandon Allbery wrote: On Mon, Aug 29, 2011 at 03:40, Andrew Coppin andrewcop...@btinternet.com mailto:andrewcop...@btinternet.com wrote: I meant if you're trying to *implement* serialisation. The Bits class allows you to access bits one by one,

[Haskell-cafe] Off-topic: Mathematics

2011-08-29 Thread Andrew Coppin
This is fairly wildly off-topic but... does anybody know of a good forum where I can ask questions about mathematics and get authoritative answers? (Apart from go visit the nearest university, that is.) ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Off-topic: Mathematics

2011-08-29 Thread Christopher Done
Possibly: http://math.stackexchange.com/ On 29 August 2011 10:34, Andrew Coppin andrewcop...@btinternet.com wrote: This is fairly wildly off-topic but... does anybody know of a good forum where I can ask questions about mathematics and get authoritative answers? (Apart from go visit the

Re: [Haskell-cafe] Off-topic: Mathematics

2011-08-29 Thread Jack Henahan
The http://math.stackexchange.com/ for normal questions, http://mathoverflow.net/ for research level questions. Jack Henahan jhena...@uvm.edu == Computer science is no more about computers than astronomy is about telescopes. -- Edsger Dijkstra == 398E692F.gpg Description:

Re: [Haskell-cafe] bitSize

2011-08-29 Thread Brandon Allbery
On Mon, Aug 29, 2011 at 04:32, Andrew Coppin andrewcop...@btinternet.comwrote: OK. But since there's no way of getting a byte count for an Integer either... The count depends on how you're serializing it; unless you are literally serializing to individual bits and sending them over a

Re: [Haskell-cafe] bitSize

2011-08-29 Thread Brandon Allbery
On Mon, Aug 29, 2011 at 04:08, Alexander Kjeldaas alexander.kjeld...@gmail.com wrote: All search engines deal with compressed integers, all compressors do, and most people doing bit-manipulation. Golomb, gamma, elias, rice coding, they all need this. Heck, even the Intel engineers chose to

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Brandon Allbery
On Mon, Aug 29, 2011 at 04:08, Michael Snoyman mich...@snoyman.com wrote: So one possible solution is to just add an option to never decompress response bodies, but that's a bit of a hack. The real question is: what's the correct way to handle these tarballs? Web browsers seem to know not to

Re: [Haskell-cafe] Unexpected Typeable behaviour; Prelude.undefined

2011-08-29 Thread Philip Holzenspies
Dear Brandon, Ozgur, et al, Thanks very much for you explanation. This seems to be a perfectly reasonable explanation; the wrapper-types I used probably explicitly invoke typeOf with undefined. The problem here, however, is that in my actual program, I don't use ADTs, but I use GADTs, so as to

Re: [Haskell-cafe] Dynamic loading of module

2011-08-29 Thread Arnaud Bailly
After reinstalling HP 2011.2.0.1 and (re)wiping out user package directory, things are in better shape and I can now compile the faulty module. I am well aware I did something wrong at some point in time but I am not really sure of what happened. I suspect things went wrong when I tried to install

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Erik de Castro Lopo
Brandon Allbery wrote: On Mon, Aug 29, 2011 at 04:08, Michael Snoyman mich...@snoyman.com wrote: So one possible solution is to just add an option to never decompress response bodies, but that's a bit of a hack. The real question is: what's the correct way to handle these tarballs? Web

Re: [Haskell-cafe] bitSize

2011-08-29 Thread Maciej Marcin Piechotka
On Fri, 2011-08-26 at 20:30 +0100, Andrew Coppin wrote: On 26/08/2011 07:36 PM, Steve Schafer wrote: On Fri, 26 Aug 2011 18:24:37 +0100, you wrote: I would usually want #3 or #4. Out of curiosity, what for? While I do occasionally need to get a logarithmic size estimate of a number

Re: [Haskell-cafe] bitSize

2011-08-29 Thread Daniel Fischer
On Monday 29 August 2011, 12:32:51, Maciej Marcin Piechotka wrote: On Fri, 2011-08-26 at 20:30 +0100, Andrew Coppin wrote: I suppose I could use a binary logarithm. I'm just concerned that it would be rather slow. After all, I'm not interested in the exact logarithm (which is fractional),

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Gregory Collins
On Mon, Aug 29, 2011 at 10:08 AM, Michael Snoyman mich...@snoyman.com wrote: Hi all, Erik just opened an issue on Github[1] that affected me very recently as well when writing some automated Hackage checking code[2]. The issue is that http-enumerator sees the content-encoding header and

[Haskell-cafe] Problems creating Haskell-dll without -fvia-C

2011-08-29 Thread KlasI
Hi! I recently read a haskell-cafe-thread telling me that the compiler option -fvia-C will be removed. This gets me a bit worried... I use -fvia-C when I build my haskell dll, and it works just fine (Haskell 2010.2.0.0): ghc -c Adder.hs -O2 -fvia-C ghc -c StartEnd.c ghc -shared -o

Re: [Haskell-cafe] Off-topic: Mathematics

2011-08-29 Thread Benedict Eastaugh
On 29 August 2011 09:34, Andrew Coppin andrewcop...@btinternet.com wrote: This is fairly wildly off-topic but... does anybody know of a good forum where I can ask questions about mathematics and get authoritative answers? Apart from math.stackexchange.com and mathoverflow.net, which people have

Re: [Haskell-cafe] Off-topic: Mathematics

2011-08-29 Thread Christopher Done
There's also #math on freenode, but it's a scary wilderness. On 29 August 2011 13:34, Benedict Eastaugh ionf...@gmail.com wrote: On 29 August 2011 09:34, Andrew Coppin andrewcop...@btinternet.com wrote: This is fairly wildly off-topic but... does anybody know of a good forum where I can ask

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Michael Snoyman
On Mon, Aug 29, 2011 at 2:21 PM, Gregory Collins g...@gregorycollins.net wrote: On Mon, Aug 29, 2011 at 10:08 AM, Michael Snoyman mich...@snoyman.com wrote: Hi all, Erik just opened an issue on Github[1] that affected me very recently as well when writing some automated Hackage checking

Re: [Haskell-cafe] bitSize

2011-08-29 Thread Steve Schafer
On Mon, 29 Aug 2011 08:40:45 +0100, you wrote: If you're doing, say, cryptography, then thousand-bit random integers that need to be serialised are fairly common... This is the part that makes no sense to me. Yes, you are absolutely correct that large, multiple-byte integers play a big role in

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Herbert Valerio Riedel
On Mon, 2011-08-29 at 13:21 +0200, Gregory Collins wrote: A web server should not be setting Content-encoding: gzip on a .tar.gz file. Why not? From RFC2616 compliant servers I'd expect a .tar.gz file to have the Content-* headers provide meta-information about the content[1], e.g.

[Haskell-cafe] Truly Really Off-topic: (Was: Mathematics)

2011-08-29 Thread Jerzy Karczmarczuk
Now, something really à côté de la plaque... Jack Henahan terminates his useful advice addressed to A. Coppin: Computer science is no more about computers than astronomy is about telescopes. -- Edsger Dijkstra This citation makes me think, and since this became rare, I share it. * It is

Re: [Haskell-cafe] Truly Really Off-topic: (Was: Mathematics)

2011-08-29 Thread Christopher Done
Wherever its origin, it is featured in SICP which was out in 1984: http://www.youtube.com/watch?v=zQLUPjefuWA It's a sound analogy. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Dynamic loading of module

2011-08-29 Thread Albert Y. C. Lai
On 11-08-29 02:41 AM, Arnaud Bailly wrote: ghc-pkg unregister --force --user template-haskell [...] ghc-pkg unregister --force --user template-haskell I am sorry. I apologize. It was not your fault. It was my fault. unregister --user drops the global instance when there is no user

Re: [Haskell-cafe] Dynamic loading of module

2011-08-29 Thread Arnaud Bailly
No offense :-) Thanks for taking the time to investigate this stuff. It gave me the opportunity to get a closer look at ghc package management. Regards, Arnaud On Mon, Aug 29, 2011 at 5:28 PM, Albert Y. C. Lai tre...@vex.net wrote: On 11-08-29 02:41 AM, Arnaud Bailly wrote: ghc-pkg

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Michael Snoyman
On Mon, Aug 29, 2011 at 5:28 PM, Herbert Valerio Riedel h...@gnu.org wrote: On Mon, 2011-08-29 at 13:21 +0200, Gregory Collins wrote: A web server should not be setting Content-encoding: gzip on a .tar.gz file. Why not? From RFC2616 compliant servers I'd expect a .tar.gz file to have the

Re: [Haskell-cafe] Truly Really Off-topic: (Was: Mathematics)

2011-08-29 Thread Gwern Branwen
On Mon, Aug 29, 2011 at 11:19 AM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: It is unsourced, repeated without discernment, and Dijkstra cannot confirm (or deny) it any more. Somehow I cannot believe he said that... Dijkstra began to study physics, and a physicist would be

Re: [Haskell-cafe] Truly Really Off-topic: (Was: Mathematics)

2011-08-29 Thread Jack Henahan
Better? Jack Henahan jhena...@uvm.edu == Computer science is no more about computers than astronomy is about telescopes…. -- Michael R. Fellows and Ian Parberry == 398E692F.gpg Description: application/apple-msg-attachment On Aug 29, 2011, at 11:47 AM, Gwern Branwen wrote: Michael R.

[Haskell-cafe] Text.Parsec.Prim

2011-08-29 Thread Roly Perera
Hi, I seem to have some trouble accessing this module. I would like to use the type synonym ParsecT directly. I'm running GHC 6.12.1. According to Hoogle, the type I want is part of parsec-3.1.1, in module Text.Parsec.Prim. But if try to import Text.Parsec.Prim, GHC complains Could not find

Re: [Haskell-cafe] Truly Really Off-topic: (Was: Mathematics)

2011-08-29 Thread Jack Henahan
In fairness, I already knew it wasn't an actual Dijkstra quote. It's just one that gets thrown around with his name on it. The origins were misty enough that I just decided to pick the one that pop culture chose. Jack Henahan jhena...@uvm.edu == Computer science is no more about computers than

Re: [Haskell-cafe] Truly Really Off-topic: (Was: Mathematics)

2011-08-29 Thread aditya siram
I'm afraid you're going to have a lot of OCD's completely miss the point of your email and annoy you with comments about the quote which you'll then have to refute. I'd actually stick with the old comment, remove it completely, include a short summary with a link to the paper or attribute it to

Re: [Haskell-cafe] Text.Parsec.Prim

2011-08-29 Thread Antoine Latter
On Mon, Aug 29, 2011 at 11:12 AM, Roly Perera roly.per...@dynamicaspects.org wrote: Hi, I seem to have some trouble accessing this module. I would like to use the type synonym ParsecT directly. I'm running GHC 6.12.1. According to Hoogle, the type I want is part of parsec-3.1.1, in module

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Gregory Collins
On Mon, Aug 29, 2011 at 4:28 PM, Herbert Valerio Riedel h...@gnu.org wrote: On Mon, 2011-08-29 at 13:21 +0200, Gregory Collins wrote: A web server should not be setting Content-encoding: gzip on a .tar.gz file. Why not? From RFC2616 compliant servers I'd expect a .tar.gz file to have the

Re: [Haskell-cafe] Text.Parsec.Prim

2011-08-29 Thread Roly Perera
Cool. I assumed that since I already had Parsec installed as part of the Haskell Platform it wouldn't have made any difference, but actually it sorted it. Thanks a lot! On 29 August 2011 18:25, Antoine Latter aslat...@gmail.com wrote: There might be something off about your packages database.

Re: [Haskell-cafe] Truly Really Off-topic: (Was: Mathematics)

2011-08-29 Thread Gwern Branwen
On Mon, Aug 29, 2011 at 12:18 PM, aditya siram aditya.si...@gmail.com wrote: I'm afraid you're going to have a lot of OCD's completely miss the point of your email and annoy you with comments about the quote which you'll then have to refute. I dunno, I found the quote interesting. I had typed

Re: [Haskell-cafe] Truly Really Off-topic: (Was: Mathematics)

2011-08-29 Thread Gwern Branwen
On Mon, Aug 29, 2011 at 11:47 AM, Gwern Branwen gwe...@gmail.com wrote: As well, in no Google hit did I find any specific citation to Dijkstra. Hence, I conclude that because it is insightful and sounds like Dijkstra (eg. his submarine quote), it has become apocryphally associated with him but

Re: [Haskell-cafe] Trouble with Haddock

2011-08-29 Thread Jason Dagit
On Sun, Aug 28, 2011 at 6:37 AM, anonymous qubi...@gmail.com wrote: First time using haddock. I'm unable to include code examples in the module header. Haddock fails with this error: haddock module header parse failed: Cannot parse header documentation paragraphs It's about 12 lines of

Re: [Haskell-cafe] GHC API question

2011-08-29 Thread Albert Y. C. Lai
On 11-08-28 11:38 AM, Chris Smith wrote: Okay, I should have waited until morning to post this... so actually, things still work fine when I build without profiling. However, when I build with profiling, I get the segfault. I'm guessing either I need to set different dynamic flags with the

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Conrad Parker
On Aug 29, 2011 9:39 PM, Michael Snoyman mich...@snoyman.com wrote: On Mon, Aug 29, 2011 at 2:21 PM, Gregory Collins g...@gregorycollins.net wrote: On Mon, Aug 29, 2011 at 10:08 AM, Michael Snoyman mich...@snoyman.com wrote: Hi all, Erik just opened an issue on Github[1] that affected

Re: [Haskell-cafe] GHC API question

2011-08-29 Thread Thomas Schilling
OK, I guess I misunderstood you. I don't know how SafeHaskell works, so I don't know whether there might be some interaction. I know that profiling is a static flag which must be set when you initialise the session and cannot be changed afterwards. I assume you are doing that. I checked the

Re: [Haskell-cafe] bitSize

2011-08-29 Thread Richard O'Keefe
On 29/08/2011, at 10:32 PM, Maciej Marcin Piechotka wrote: According to random side (http://gruntthepeon.free.fr/ssemath/) not so new computers can compute 15.5 milions of serial logarithms per second (62 millions in total). I'd say that overhead of Integer might be much bigger then cost of

Re: [Haskell-cafe] [xmonad] Cabal install problem

2011-08-29 Thread Brent Yorgey
On Tue, Aug 30, 2011 at 12:30:08AM +0300, Tayfur Yilmaz wrote: Quoting Tayfur Yilmaz yilmaz.tay...@gmail.com: Hi everyone I have some problem for install 'cabal-install package' I downloaded and succesfully build a binary source ghc-7.0.2. Then I want to install

Re: [Haskell-cafe] Pointed, but not Applicative

2011-08-29 Thread Ryan Ingram
On Sun, Aug 28, 2011 at 8:24 PM, Maciej Marcin Piechotka uzytkown...@gmail.com wrote: f `fmap` FList g = _|_ f `fmap` FList g = map id f `fmap` FList g = map _|_ (+ variation of _|_*) f `fmap` FList g = \bs - map f (g []) ++ bs ___ Haskell-Cafe

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Erik de Castro Lopo
Michael Snoyman wrote: I'm wondering what the most appropriate way to handle this is. Just to get my thoughts in order I'll back track a little. In the HTTP repsonse, we have two header fields, content-type and content-encoding. For the later (which may be absent) we can have encodings of gzip

Re: [Haskell-cafe] [xmonad] Cabal install problem

2011-08-29 Thread Albert Y. C. Lai
I am also interested in the complete output of ghc -v and ghc-pkg list -v. Meanwhile, the pros may notice that Configuring Cabal-1.10.1.0... is very suspicious because GHC 7.0.2 comes with exactly Cabal-1.10.1.0, so there is no normal reason why it is being re-installed (cabal-install's

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Michael Snoyman
On Tue, Aug 30, 2011 at 6:27 AM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Michael Snoyman wrote: I'm wondering what the most appropriate way to handle this is. Just to get my thoughts in order I'll back track a little. In the HTTP repsonse, we have two header fields, content-type

Re: [Haskell-cafe] GHCI Feature Request: Last Successful Compilation State Saved

2011-08-29 Thread Albert Y. C. Lai
On 11-08-27 04:59 PM, aditya siram wrote: Many times I've changed files, loaded them, hit a compilation error and needed, for example, the inferred type signature of some function. Even though that function hasn't been changed I have to either fix my code, undo a bunch of changes or comment out

Re: [Haskell-cafe] Decompressing and http-enumerator

2011-08-29 Thread Erik de Castro Lopo
Michael Snoyman wrote: I think we should invert the logic of this (to avoid double negatives) so we have:     type ContentType = ByteString     decompress :: ContentType - Bool     browserDecompress = (/== application/x-tar)     defaultDecompress = const True No objections from

Re: [Haskell-cafe] Unexpected Typeable behaviour; Prelude.undefined

2011-08-29 Thread Ryan Ingram
The problem with hiding the context in the constructor is that there's no guarantee that the context actually exists in the first place; for example, given this type data IsInt a where Proof :: IsInt Int this is a legal program: foo :: IsInt Bool foo = undefined That said, you are still

Re: [Haskell-cafe] Pointed, but not Applicative

2011-08-29 Thread Maciej Marcin Piechotka
On Mon, 2011-08-29 at 20:24 -0700, Ryan Ingram wrote: On Sun, Aug 28, 2011 at 8:24 PM, Maciej Marcin Piechotka uzytkown...@gmail.com wrote: f `fmap` FList g = _|_ f `fmap` FList g = map id f `fmap` FList g = map _|_ (+ variation of _|_*) f `fmap` FList