Re: [Haskell-cafe] [web-devel] http-enumerator: users?
If no one else wants to be responsible for maintaining, I vote for deprecation. On Thu, Apr 19, 2012 at 2:33 AM, Michael Snoyman mich...@snoyman.com wrote: Hi all, I'm wondering if there are still active users out there of http-enumerator. Four months ago I released http-conduit, and since then, my development efforts have gone almost exclusively there. At this point, I'm not longer actively using http-enumerator on any of my projects, and while I've backported any security fixes to http-enumerator, it is otherwise not be updated. I see three possibilities for the future of http-enumerator: 1. Deprecate it in favor of http-conduit 2. Someone else takes over as maintainer 3. Turn it into a frontend for http-conduit, exposing an enumerator interface. This will likely, though not necessarily, result in API breakage I'm curious how others feel on this. If I don't hear anything back on the topic, I'll assume that no one is interested in http-enumerator, and thus will opt for option (1). Michael ___ web-devel mailing list web-de...@haskell.org http://www.haskell.org/mailman/listinfo/web-devel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] bindings for libvirt
Ilya, Yes please. Examining your code would go a long way toward helping me with this project. On Mon, Jan 23, 2012 at 9:26 PM, Ilya Portnov port...@iportnov.ru wrote: On 16 янв, 03:27, Michael Litchard mich...@schmong.org wrote: Due to the direction things are going at work, I have become interested in Haskell bindings forlibvirt. Noticed that this hasn't been done yet. I was wondering if this was due to lack of motivation, or if there were some difficult hurdles withlibvirtthat make the project cost-prohibitive. If it's the former, I don't see a problem proceeding with exploration. If it's the latter, I'd like to know what the hurdles are. Hello. For my current projects, i'd also like to have bindings to libvirt. I even started to write something for them, using c2hs. If someone is interested, i could put my current (very basic) code to, say, github... Seems there will no big problems, but libvirt API is not so small, so it'll take time to write full bindings. WBR, Ilya Portnov. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] bindings for libvirt
Due to the direction things are going at work, I have become interested in Haskell bindings for libvirt. Noticed that this hasn't been done yet. I was wondering if this was due to lack of motivation, or if there were some difficult hurdles with libvirt that make the project cost-prohibitive. If it's the former, I don't see a problem proceeding with exploration. If it's the latter, I'd like to know what the hurdles are. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] bindings for libvirt
That's encouraging! On Sun, Jan 15, 2012 at 1:41 PM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Michael Litchard wrote: Due to the direction things are going at work, I have become interested in Haskell bindings for libvirt. Noticed that this hasn't been done yet. Interesting! I was wondering if this was due to lack of motivation, or if there were some difficult hurdles with libvirt that make the project cost-prohibitive. Well there are already Ocaml bindings for libvirt http://libvirt.org/ocaml/ so its most likely the former. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] What happens if you get hit by a bus?
I'm learning what it means to be a professional Haskell programmer, and contemplating taking on side jobs. The path of least resistance seems to be web applications, as that is what I do at work. I've been investigating what some web developers have to say about their trade. One article addresses the question above. His answer was that he uses RoR which has a large community and he is therefore easily replaceable. My question, for freelancers in general, and web developers in particular is this: How do you address this question? I imagine potential clients would need to be assuaged of their fears that hiring me would lead to a lock-in situation at best, and no one to maintain a code base at worst. Lock-in won't be part of my business model, also sooner or later we part ways with the client. When the client wonders, What happens then?, what is a good answer? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What happens if you get hit by a bus?
Yes! I could cite the large and growing set of libraries on hackage as evidence. On Fri, Dec 16, 2011 at 7:40 AM, Colin Adams colinpaulad...@gmail.com wrote: I would think there were plenty of Haskell programmers ready to jump in as replacements. On 16 December 2011 15:37, Michael Litchard mich...@schmong.org wrote: I'm learning what it means to be a professional Haskell programmer, and contemplating taking on side jobs. The path of least resistance seems to be web applications, as that is what I do at work. I've been investigating what some web developers have to say about their trade. One article addresses the question above. His answer was that he uses RoR which has a large community and he is therefore easily replaceable. My question, for freelancers in general, and web developers in particular is this: How do you address this question? I imagine potential clients would need to be assuaged of their fears that hiring me would lead to a lock-in situation at best, and no one to maintain a code base at worst. Lock-in won't be part of my business model, also sooner or later we part ways with the client. When the client wonders, What happens then?, what is a good answer? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Hackage down!
Does anyone know of a hackage mirror? It now occurs to me I should have a local mirror, it's that essential. On Thu, Dec 1, 2011 at 9:24 AM, Malcolm Wallace malcolm.wall...@me.com wrote: And, amusingly, http://downforeveryoneorjustme.com/ is also down, having exceeded its Google App Engine quota. [ But the similarly named .org site still works, and confirms that hackage is down. ] Regards, Malcolm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] What is the etiquette for posting to multiple forums?
I know it's bad form to post the same question to multiple mailing lists. But what about say, the beginner's mailing list and stackoverflow.com? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] pattern matching instead of prelude.head
Someone commented on StackOverflow that pattern matching the first element of a list was preferable to head. This makes sense intuitively. Could someone articulate the reason why this is true? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] *GROUP HUG*
I disagree. I'm by no means proficient in Haskell. And, I never bothered learning PHP. I will when I need to. PHP programmers are a dime a dozen. It's been my experience that Haskell is a tool one may use to distinguish oneself from the hoi-poloi. This is important when you live in an area where the baker down the street has a CS degree. On Thu, Jun 2, 2011 at 11:52 AM, Yves Parès limestr...@gmail.com wrote: Learning Haskell will pay off much less than learning PHP, if your goal is to find a job. Amen. I cannot agree with this for practical reasons. I'm using Haskell for real world commercial applications, and I'm very productive with it. I wish so much I could say that... Out of curiosity, what are you using Haskell for? 2011/6/2 Ertugrul Soeylemez e...@ertes.de Alberto G. Corona agocor...@gmail.com wrote: Haskell is an academic asset as well as a fun asset. I cannot agree with this for practical reasons. I'm using Haskell for real world commercial applications, and I'm very productive with it. There is however a variation of this statement, with which I could agree, namely: Learning Haskell will pay off much less than learning PHP, if your goal is to find a job. It takes a lot longer and there are a lot less companies in need of Haskell programmers. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife = sex) http://ertes.de/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] *GROUP HUG*
Being able to use Haskell at such an early stage of my programming career has given me high expectations of what comes next. On Thu, Jun 2, 2011 at 3:22 PM, David Leimbach leim...@gmail.com wrote: I got hired at a company because one of the interviewers was impressed that I taught myself Haskell. I basically never use it at work, but I did in my old job. Dave On Thu, Jun 2, 2011 at 2:23 PM, Michael Litchard mich...@schmong.org wrote: I disagree. I'm by no means proficient in Haskell. And, I never bothered learning PHP. I will when I need to. PHP programmers are a dime a dozen. It's been my experience that Haskell is a tool one may use to distinguish oneself from the hoi-poloi. This is important when you live in an area where the baker down the street has a CS degree. On Thu, Jun 2, 2011 at 11:52 AM, Yves Parès limestr...@gmail.com wrote: Learning Haskell will pay off much less than learning PHP, if your goal is to find a job. Amen. I cannot agree with this for practical reasons. I'm using Haskell for real world commercial applications, and I'm very productive with it. I wish so much I could say that... Out of curiosity, what are you using Haskell for? 2011/6/2 Ertugrul Soeylemez e...@ertes.de Alberto G. Corona agocor...@gmail.com wrote: Haskell is an academic asset as well as a fun asset. I cannot agree with this for practical reasons. I'm using Haskell for real world commercial applications, and I'm very productive with it. There is however a variation of this statement, with which I could agree, namely: Learning Haskell will pay off much less than learning PHP, if your goal is to find a job. It takes a lot longer and there are a lot less companies in need of Haskell programmers. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife = sex) http://ertes.de/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] *GROUP HUG*
The community plays a large part of why I am using Haskell professionally. The Haskell ecosystem is first-rate all by itself, but I would have been dead in the water months ago without the community. On Mon, May 23, 2011 at 10:10 PM, Gregory Crosswhite gcr...@phys.washington.edu wrote: Hey everyone, Okay, this will sound silly, but I ventured into the Scala mailing list recently and asked an ignorant question on it, and I was shocked when people reacted not by enlightening me but by jumping on me and reacting with hostility. I bring this up not to badmouth the Scala community (they are apparently going through growing pains and will hopefully mature with time!) but just because it made me appreciate just how awesome you guys are, so I just feel the need to publicly express my admiration and thank to everyone on this list for having fostered such an incredibly professional, fanatically nonhostile, and generally pleasant place to talk about Haskell!!! *GROUP HUG* Okay, I'm done now. :-) Cheers, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] request for example code referenced in All About Monads
The html version of All About Monads has dissapeared, so I am making due with the pdf version. As a consequence I don't have access to the example code files referenced. I know someone out there has them. Could you make them available please? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] errors while installing yesod 0.8
I started mindlessly pasting in the output, and the following lept out at me: , package authenticate-0.8.2.2-cc3ed2c523ecbf1ad123c3468785149e is unusable due to missing or recursive dependencies: http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 package http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 is unusable due to missing or recursive dependencies: attoparsec-enumerator-0.2.0.3-4978ab2dc4d87b7b724534bbfdcb07f1 package json-enumerator-0.0.1-7d4b724ae8c9b5ffa92da26856c4e1f1 is unusable due to missing or recursive dependencies: blaze-builder-enumerator-0.2.0.1-23e6e1f270358d3329f627e3a5ce8838 package wai-extra-0.3.2-f8378ad4a5cc6f375d96b718876384fa is unusable due to missing or recursive dependencies: There's more of the same I'm leaving out. I'm going to see if I can go somewhere with these error messages. If I totally hose things, I'll let you guys know. On Tue, Apr 19, 2011 at 4:45 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Wednesday 20 April 2011 01:22:20, Michael Litchard wrote: So what else can I try? $ cabal install -v3 monad-control That should give some hints at which point exactly things fail. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] errors while installing yesod 0.8
Following the install trail I run into this problem mlitchard@apotheosis:~$ cab install JSONb-1.0.2 Resolving dependencies... Configuring JSONb-1.0.2... Preprocessing library JSONb-1.0.2... Preprocessing executables for JSONb-1.0.2... Building JSONb-1.0.2... [1 of 7] Compiling Text.JSON.Escape ( Text/JSON/Escape.hs, dist/build/Text/JSON/Escape.o ) [2 of 7] Compiling Text.JSONb.Simple ( Text/JSONb/Simple.hs, dist/build/Text/JSONb/Simple.o ) [3 of 7] Compiling Text.JSONb.Decode ( Text/JSONb/Decode.hs, dist/build/Text/JSONb/Decode.o ) Text/JSONb/Decode.hs:56:33: Ambiguous occurrence `number' It could refer to either `Text.JSONb.Decode.number', defined at Text/JSONb/Decode.hs:118:0 or `Attoparsec.number', imported from Data.Attoparsec.Char8 at Text/JSONb/Decode.hs:25:0-52 cabal: Error: some packages failed to install: JSONb-1.0.2 failed during the building phase. The exception was: ExitFailure 1 How do I clear up this ambiguity? On Mon, Apr 25, 2011 at 1:24 PM, Michael Litchard mich...@schmong.org wrote: I started mindlessly pasting in the output, and the following lept out at me: , package authenticate-0.8.2.2-cc3ed2c523ecbf1ad123c3468785149e is unusable due to missing or recursive dependencies: http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 package http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 is unusable due to missing or recursive dependencies: attoparsec-enumerator-0.2.0.3-4978ab2dc4d87b7b724534bbfdcb07f1 package json-enumerator-0.0.1-7d4b724ae8c9b5ffa92da26856c4e1f1 is unusable due to missing or recursive dependencies: blaze-builder-enumerator-0.2.0.1-23e6e1f270358d3329f627e3a5ce8838 package wai-extra-0.3.2-f8378ad4a5cc6f375d96b718876384fa is unusable due to missing or recursive dependencies: There's more of the same I'm leaving out. I'm going to see if I can go somewhere with these error messages. If I totally hose things, I'll let you guys know. On Tue, Apr 19, 2011 at 4:45 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Wednesday 20 April 2011 01:22:20, Michael Litchard wrote: So what else can I try? $ cabal install -v3 monad-control That should give some hints at which point exactly things fail. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] errors while installing yesod 0.8
So it appears this is a bug with JSONb-1.0.2. There's a new version out. IS the answer to use that, or to patch this version? On Mon, Apr 25, 2011 at 1:48 PM, Michael Litchard mich...@schmong.org wrote: Following the install trail I run into this problem mlitchard@apotheosis:~$ cab install JSONb-1.0.2 Resolving dependencies... Configuring JSONb-1.0.2... Preprocessing library JSONb-1.0.2... Preprocessing executables for JSONb-1.0.2... Building JSONb-1.0.2... [1 of 7] Compiling Text.JSON.Escape ( Text/JSON/Escape.hs, dist/build/Text/JSON/Escape.o ) [2 of 7] Compiling Text.JSONb.Simple ( Text/JSONb/Simple.hs, dist/build/Text/JSONb/Simple.o ) [3 of 7] Compiling Text.JSONb.Decode ( Text/JSONb/Decode.hs, dist/build/Text/JSONb/Decode.o ) Text/JSONb/Decode.hs:56:33: Ambiguous occurrence `number' It could refer to either `Text.JSONb.Decode.number', defined at Text/JSONb/Decode.hs:118:0 or `Attoparsec.number', imported from Data.Attoparsec.Char8 at Text/JSONb/Decode.hs:25:0-52 cabal: Error: some packages failed to install: JSONb-1.0.2 failed during the building phase. The exception was: ExitFailure 1 How do I clear up this ambiguity? On Mon, Apr 25, 2011 at 1:24 PM, Michael Litchard mich...@schmong.org wrote: I started mindlessly pasting in the output, and the following lept out at me: , package authenticate-0.8.2.2-cc3ed2c523ecbf1ad123c3468785149e is unusable due to missing or recursive dependencies: http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 package http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 is unusable due to missing or recursive dependencies: attoparsec-enumerator-0.2.0.3-4978ab2dc4d87b7b724534bbfdcb07f1 package json-enumerator-0.0.1-7d4b724ae8c9b5ffa92da26856c4e1f1 is unusable due to missing or recursive dependencies: blaze-builder-enumerator-0.2.0.1-23e6e1f270358d3329f627e3a5ce8838 package wai-extra-0.3.2-f8378ad4a5cc6f375d96b718876384fa is unusable due to missing or recursive dependencies: There's more of the same I'm leaving out. I'm going to see if I can go somewhere with these error messages. If I totally hose things, I'll let you guys know. On Tue, Apr 19, 2011 at 4:45 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Wednesday 20 April 2011 01:22:20, Michael Litchard wrote: So what else can I try? $ cabal install -v3 monad-control That should give some hints at which point exactly things fail. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] errors while installing yesod 0.8
I think something that yesod uses, uses JSONb. Also, I think I have borked my haskell environment to the point where it may be best to zap it and start over. On Mon, Apr 25, 2011 at 3:05 PM, Rogan Creswick cresw...@gmail.com wrote: On Mon, Apr 25, 2011 at 2:44 PM, Michael Litchard mich...@schmong.org wrote: So it appears this is a bug with JSONb-1.0.2. There's a new version out. IS the answer to use that, or to patch this version? If there is a new version, and you indeed need JSONb for something, then you should use the newer version (yesod doesn't depend on it, so I'm a bit unsure why it came up...). --Rogan On Mon, Apr 25, 2011 at 1:48 PM, Michael Litchard mich...@schmong.org wrote: Following the install trail I run into this problem mlitchard@apotheosis:~$ cab install JSONb-1.0.2 Resolving dependencies... Configuring JSONb-1.0.2... Preprocessing library JSONb-1.0.2... Preprocessing executables for JSONb-1.0.2... Building JSONb-1.0.2... [1 of 7] Compiling Text.JSON.Escape ( Text/JSON/Escape.hs, dist/build/Text/JSON/Escape.o ) [2 of 7] Compiling Text.JSONb.Simple ( Text/JSONb/Simple.hs, dist/build/Text/JSONb/Simple.o ) [3 of 7] Compiling Text.JSONb.Decode ( Text/JSONb/Decode.hs, dist/build/Text/JSONb/Decode.o ) Text/JSONb/Decode.hs:56:33: Ambiguous occurrence `number' It could refer to either `Text.JSONb.Decode.number', defined at Text/JSONb/Decode.hs:118:0 or `Attoparsec.number', imported from Data.Attoparsec.Char8 at Text/JSONb/Decode.hs:25:0-52 cabal: Error: some packages failed to install: JSONb-1.0.2 failed during the building phase. The exception was: ExitFailure 1 How do I clear up this ambiguity? On Mon, Apr 25, 2011 at 1:24 PM, Michael Litchard mich...@schmong.org wrote: I started mindlessly pasting in the output, and the following lept out at me: , package authenticate-0.8.2.2-cc3ed2c523ecbf1ad123c3468785149e is unusable due to missing or recursive dependencies: http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 package http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 is unusable due to missing or recursive dependencies: attoparsec-enumerator-0.2.0.3-4978ab2dc4d87b7b724534bbfdcb07f1 package json-enumerator-0.0.1-7d4b724ae8c9b5ffa92da26856c4e1f1 is unusable due to missing or recursive dependencies: blaze-builder-enumerator-0.2.0.1-23e6e1f270358d3329f627e3a5ce8838 package wai-extra-0.3.2-f8378ad4a5cc6f375d96b718876384fa is unusable due to missing or recursive dependencies: There's more of the same I'm leaving out. I'm going to see if I can go somewhere with these error messages. If I totally hose things, I'll let you guys know. On Tue, Apr 19, 2011 at 4:45 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Wednesday 20 April 2011 01:22:20, Michael Litchard wrote: So what else can I try? $ cabal install -v3 monad-control That should give some hints at which point exactly things fail. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] errors while installing yesod 0.8
Oh yeah, this began while trying to install by hand authenticate-0.8.2.2 On Mon, Apr 25, 2011 at 3:10 PM, Michael Litchard mich...@schmong.org wrote: I think something that yesod uses, uses JSONb. Also, I think I have borked my haskell environment to the point where it may be best to zap it and start over. On Mon, Apr 25, 2011 at 3:05 PM, Rogan Creswick cresw...@gmail.com wrote: On Mon, Apr 25, 2011 at 2:44 PM, Michael Litchard mich...@schmong.org wrote: So it appears this is a bug with JSONb-1.0.2. There's a new version out. IS the answer to use that, or to patch this version? If there is a new version, and you indeed need JSONb for something, then you should use the newer version (yesod doesn't depend on it, so I'm a bit unsure why it came up...). --Rogan On Mon, Apr 25, 2011 at 1:48 PM, Michael Litchard mich...@schmong.org wrote: Following the install trail I run into this problem mlitchard@apotheosis:~$ cab install JSONb-1.0.2 Resolving dependencies... Configuring JSONb-1.0.2... Preprocessing library JSONb-1.0.2... Preprocessing executables for JSONb-1.0.2... Building JSONb-1.0.2... [1 of 7] Compiling Text.JSON.Escape ( Text/JSON/Escape.hs, dist/build/Text/JSON/Escape.o ) [2 of 7] Compiling Text.JSONb.Simple ( Text/JSONb/Simple.hs, dist/build/Text/JSONb/Simple.o ) [3 of 7] Compiling Text.JSONb.Decode ( Text/JSONb/Decode.hs, dist/build/Text/JSONb/Decode.o ) Text/JSONb/Decode.hs:56:33: Ambiguous occurrence `number' It could refer to either `Text.JSONb.Decode.number', defined at Text/JSONb/Decode.hs:118:0 or `Attoparsec.number', imported from Data.Attoparsec.Char8 at Text/JSONb/Decode.hs:25:0-52 cabal: Error: some packages failed to install: JSONb-1.0.2 failed during the building phase. The exception was: ExitFailure 1 How do I clear up this ambiguity? On Mon, Apr 25, 2011 at 1:24 PM, Michael Litchard mich...@schmong.org wrote: I started mindlessly pasting in the output, and the following lept out at me: , package authenticate-0.8.2.2-cc3ed2c523ecbf1ad123c3468785149e is unusable due to missing or recursive dependencies: http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 package http-enumerator-0.3.1-719bcd77e1dcb62efc9cf9b4f0b72271 is unusable due to missing or recursive dependencies: attoparsec-enumerator-0.2.0.3-4978ab2dc4d87b7b724534bbfdcb07f1 package json-enumerator-0.0.1-7d4b724ae8c9b5ffa92da26856c4e1f1 is unusable due to missing or recursive dependencies: blaze-builder-enumerator-0.2.0.1-23e6e1f270358d3329f627e3a5ce8838 package wai-extra-0.3.2-f8378ad4a5cc6f375d96b718876384fa is unusable due to missing or recursive dependencies: There's more of the same I'm leaving out. I'm going to see if I can go somewhere with these error messages. If I totally hose things, I'll let you guys know. On Tue, Apr 19, 2011 at 4:45 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Wednesday 20 April 2011 01:22:20, Michael Litchard wrote: So what else can I try? $ cabal install -v3 monad-control That should give some hints at which point exactly things fail. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] errors while installing yesod 0.8
In case this ever gets googled ... I'm pretty sure this problem had to do with my environment. I removed $HOME/.cabal and $HOME/.ghc, and upgraded to the latest stable haskell platform. yesod 0.8 has installed fine. I'm not sure what the exact problem was however. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] errors while installing yesod 0.8
Trying to install yesod 0.8 breaks when it's time to install monad-control. Google wasn't very helpful, nor was the error message I received mlitchard@apotheosis:~/monad-control$ cabal install Resolving dependencies... Configuring monad-control-0.2.0.1... cabal: Error: some packages failed to install: monad-control-0.2.0.1 failed during the configure step. The exception was: ExitFailure 11 note: I've been trying to use the cab command to manage my packages, I get the same error as above when I use cab instead of cabal.I mention this just in case there is some unforseen problem having to do with cab/cabal interaction. Has anyone experienced this problem, or know what I can do to get more useful error messages that might reveal the cause of the breakage? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] errors while installing yesod 0.8
OS Linux apotheosis 2.6.35-22-server #33-Ubuntu SMP Sun Sep 19 20:48:58 UTC 2010 x86_64 GNU/Linux GHC The Glorious Glasgow Haskell Compilation System, version 6.12.3 Is the problem here that I'm not using ghc 7? I try to be conservative with my compiler upgrades. But if this might be the problem it seems like a simple enough fix. On Tue, Apr 19, 2011 at 2:41 PM, Michael Snoyman mich...@snoyman.com wrote: I haven't seen this error. What version of GHC are you using, and what OS? Michael On Wed, Apr 20, 2011 at 12:18 AM, Michael Litchard mich...@schmong.org wrote: Trying to install yesod 0.8 breaks when it's time to install monad-control. Google wasn't very helpful, nor was the error message I received mlitchard@apotheosis:~/monad-control$ cabal install Resolving dependencies... Configuring monad-control-0.2.0.1... cabal: Error: some packages failed to install: monad-control-0.2.0.1 failed during the configure step. The exception was: ExitFailure 11 note: I've been trying to use the cab command to manage my packages, I get the same error as above when I use cab instead of cabal.I mention this just in case there is some unforseen problem having to do with cab/cabal interaction. Has anyone experienced this problem, or know what I can do to get more useful error messages that might reveal the cause of the breakage? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] errors while installing yesod 0.8
New information, may be helpful. I manually installed hamlet 0.8 with cabal-dev, and it seemed to install. Here is the message Registering hamlet-0.8.0... Installing library in /home/mlitchard/hamlet-0.8.0/cabal-dev//lib/hamlet-0.8.0/ghc-6.12.3 Registering hamlet-0.8.0... Then I tried to manually install yesod. Here's what I got. mlitchard@apotheosis:~$ cd yesod-0.8.0/ mlitchard@apotheosis:~/yesod-0.8.0$ cabal-dev install Resolving dependencies... cabal: cannot configure yesod-0.8.0. It requires hamlet ==0.8.* There is no available version of hamlet that satisfies ==0.8.* I noticed it did not install in the $HOME/.cabal/ path. How do make sure it does that? I think if I can get it to install in the right place this will work out. On Tue, Apr 19, 2011 at 2:52 PM, Rogan Creswick cresw...@gmail.com wrote: On Tue, Apr 19, 2011 at 2:18 PM, Michael Litchard mich...@schmong.org wrote: mlitchard@apotheosis:~/monad-control$ cabal install Resolving dependencies... Configuring monad-control-0.2.0.1... cabal: Error: some packages failed to install: monad-control-0.2.0.1 failed during the configure step. The exception was: ExitFailure 11 note: I've been trying to use the cab command to manage my packages, I get the same error as above when I use cab instead of cabal.I mention this just in case there is some unforseen problem having to do with cab/cabal interaction. Has anyone experienced this problem, or know what I can do to get more useful error messages that might reveal the cause of the breakage? You might learn more by issuing the configure / build steps manually (I think `cabal configure` will produce an error). Upping the verbosity will also help: # get pages and pages of details: $ cabal install --verbose=3 I would first suggest trying cabal-dev, though (cab can delegate to cabal-dev now too, but I haven't played with it yet). $ cabal-dev install yesod-0.8 will either work or fail in a way that we can more easily reproduce. --Rogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] errors while installing yesod 0.8
yesod-0.8.0 depends on monad-control-0.2.0.1 which failed to install. yesod-auth-0.4.0 depends on monad-control-0.2.0.1 which failed to install. yesod-core-0.8.0 depends on monad-control-0.2.0.1 which failed to install. yesod-form-0.1.0 depends on monad-control-0.2.0.1 which failed to install. yesod-json-0.1.0 depends on monad-control-0.2.0.1 which failed to install. yesod-persistent-0.1.0 depends on monad-control-0.2.0.1 which failed to install. yesod-static-0.1.0 depends on monad-control-0.2.0.1 which failed to install. This is what happened after I did cabal update, then cabal-dev install yesod. This is the original error I received. So what else can I try? On Tue, Apr 19, 2011 at 3:30 PM, Rogan Creswick cresw...@gmail.com wrote: On Tue, Apr 19, 2011 at 3:10 PM, Michael Litchard mich...@schmong.org wrote: New information, may be helpful. I manually installed hamlet 0.8 with cabal-dev, and it seemed to install. Here is the message Registering hamlet-0.8.0... Installing library in /home/mlitchard/hamlet-0.8.0/cabal-dev//lib/hamlet-0.8.0/ghc-6.12.3 Registering hamlet-0.8.0... It looks like you manually downloaded the hamlet-0.8.0.tar.gz, unpacked it, and ran cabal-dev install from inside there -- is that right? (There's nothing wrong with doing it that way, but it doesn't quite do what you expected, based on the rest of your email. Also, if my assumption is wrong, then the rest of my advice may not help.) First, it's important to know that cabal-dev sandboxes everything it can. If you want to install hamlet into your .cabal directory, then you need to use cabal, not cabal-dev. Cabal-dev is meant to keep everything for a given project separate from everything else -- in this way you can have multiple projects that depend on conflicting libraries building at the same time, and it also means that coincidental changes to your user package database won't cause spurious *successes* when you build something, which is a surprisingly common problem. Unfortunately this means that the first time you build a project with cabal-dev, it tends to take a long time (it has to build everything it depends on). Now, there are (at least) two important take-away points / implications of using cabal-dev: (1) cabal-dev won't install a library into a standard location. That's by design, so you don't usually want to cabal-dev install dependencies manually. (2) cabal-dev uses the local hackage cache to select packages in the same way cabal does (cabal-dev actually just uses cabal to do this). mlitchard@apotheosis:~/yesod-0.8.0$ cabal-dev install Resolving dependencies... cabal: cannot configure yesod-0.8.0. It requires hamlet ==0.8.* There is no available version of hamlet that satisfies ==0.8.* I think you just need to run 'cabal update' so cabal-dev can see the latest version of hamlet, after which you can cabal-dev install yesod. There are a couple other things to try if that doesn't work for some reason. --Rogan I noticed it did not install in the $HOME/.cabal/ path. How do make sure it does that? I think if I can get it to install in the right place this will work out. On Tue, Apr 19, 2011 at 2:52 PM, Rogan Creswick cresw...@gmail.com wrote: On Tue, Apr 19, 2011 at 2:18 PM, Michael Litchard mich...@schmong.org wrote: mlitchard@apotheosis:~/monad-control$ cabal install Resolving dependencies... Configuring monad-control-0.2.0.1... cabal: Error: some packages failed to install: monad-control-0.2.0.1 failed during the configure step. The exception was: ExitFailure 11 note: I've been trying to use the cab command to manage my packages, I get the same error as above when I use cab instead of cabal.I mention this just in case there is some unforseen problem having to do with cab/cabal interaction. Has anyone experienced this problem, or know what I can do to get more useful error messages that might reveal the cause of the breakage? You might learn more by issuing the configure / build steps manually (I think `cabal configure` will produce an error). Upping the verbosity will also help: # get pages and pages of details: $ cabal install --verbose=3 I would first suggest trying cabal-dev, though (cab can delegate to cabal-dev now too, but I haven't played with it yet). $ cabal-dev install yesod-0.8 will either work or fail in a way that we can more easily reproduce. --Rogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] working off a Yesod example file, need help lifting values from one monad into another. (and probably other things too).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 I'm working off of a example file from Yesod, ajax.lhs I've made an important change in types, and this has resulted in having to make the old code conform to the change. I will point out the specifics, then present my question. In the event I failed to include important information, I will paste in my code as well as the prototype. [Original] getHomeR :: Handler () getHomeR = do Ajax pages _ - getYesod let first = head pages redirect RedirectTemporary $ PageR $ pageSlug first [Changed] getHomeR :: Handler () getHomeR = do Tframe pages _ - getYesod let first = head pages redirect RedirectTemporary $ PageR $ pageSlug first Error Message test.lhs:62:4: Constructor `Tframe' should have 2 arguments, but has been given 1 In the pattern: Tframe pages In a stmt of a 'do' expression: Tframe pages - getYesod This is not what I wrote * In the expression: do { Tframe pages - getYesod; content - widgetToPageContent widget; hamletToRepHtml (hamlet-0.7.1:Text.Hamlet.Quasi.toHamletValue (do { (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad . preEscapedString) !DOCTYPE htmlhtmlheadtitle; (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad . Text.Blaze.toHtml) (Main.pageTitle content); })) } As far as I can tell, I only made a cosmetic change. I don't know what's going on here. [Original] data Page = Page { pageName :: String , pageSlug :: String , pageContent :: String I'm going to change this ** } [Changed] data Page = Page { pageTitle :: String , pageSlug :: String -- ^ used in the URL , pageContent :: IO String This is the change *** } Here's where I run into trouble [Original] json page = jsonMap [ (name, jsonScalar $ pageName page) , (content, jsonScalar $ pageContent page) I'm going to change this ] [My changes] json page = jsonMap [ (name, jsonScalar $ Main.pageTitle page) , (content, jsonScalar $ liftIO $ pageContent page) *** This is the change *** ] Here's the compiler error test.lhs:107:35: Couldn't match expected type `Char' against inferred type `[Char]' Expected type: String Inferred type: [String] In the second argument of `($)', namely `liftIO $ pageContent page' In the expression: jsonScalar $ liftIO $ pageContent page Failed, modules loaded: none. I'd appreciate a discussion about why this is wrong, and perhaps clues as to what is right. Last problem, stemming from the change in type to IO String. I don't have a clue as to what change I should make. test.lhs:100:25: No instance for (Text.Blaze.ToHtml (IO String)) arising from a use of `Text.Blaze.toHtml' at test.lhs:(100,25)-(103,3) Possible fix: add an instance declaration for (Text.Blaze.ToHtml (IO String)) In the second argument of `(.)', namely `Text.Blaze.toHtml' In a stmt of a 'do' expression: (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad . Text.Blaze.toHtml) (pageContent page) In the first argument of `hamlet-0.7.1:Text.Hamlet.Quasi.toHamletValue', nam ely `do { (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad . preEscapedString) h1;
Re: [Haskell-cafe] working off a Yesod example file, need help lifting values from one monad into another. (and probably other things too).
I just noticed those. I think that came from hpaste. The first mail was a cut and paste from a post I made there. When I went to look at your reply, I had the very same question as you. On Mon, Mar 28, 2011 at 7:51 PM, Luke Palmer lrpal...@gmail.com wrote: On Mon, Mar 28, 2011 at 6:28 PM, Michael Litchard mich...@schmong.org wrote: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 Ready or not, here I come. What is the purposes of these 368 numbers? Luke I'm working off of a example file from Yesod, ajax.lhs I've made an important change in types, and this has resulted in having to make the old code conform to the change. I will point out the specifics, then present my question. In the event I failed to include important information, I will paste in my code as well as the prototype. [Original] getHomeR :: Handler () getHomeR = do Ajax pages _ - getYesod let first = head pages redirect RedirectTemporary $ PageR $ pageSlug first [Changed] getHomeR :: Handler () getHomeR = do Tframe pages _ - getYesod let first = head pages redirect RedirectTemporary $ PageR $ pageSlug first Error Message test.lhs:62:4: Constructor `Tframe' should have 2 arguments, but has been given 1 In the pattern: Tframe pages In a stmt of a 'do' expression: Tframe pages - getYesod This is not what I wrote * In the expression: do { Tframe pages - getYesod; content - widgetToPageContent widget; hamletToRepHtml (hamlet-0.7.1:Text.Hamlet.Quasi.toHamletValue (do { (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad . preEscapedString) !DOCTYPE htmlhtmlheadtitle; (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad . Text.Blaze.toHtml) (Main.pageTitle content); })) } As far as I can tell, I only made a cosmetic change. I don't know what's going on here. [Original] data Page = Page { pageName :: String , pageSlug :: String , pageContent :: String I'm going to change this ** } [Changed] data Page = Page { pageTitle :: String , pageSlug :: String -- ^ used in the URL , pageContent :: IO String This is the change *** } Here's where I run into trouble [Original] json page = jsonMap [ (name, jsonScalar $ pageName page) , (content, jsonScalar $ pageContent page) I'm going to change this ] [My changes] json page = jsonMap [ (name, jsonScalar $ Main.pageTitle page) , (content, jsonScalar $ liftIO $ pageContent page) *** This is the change *** ] Here's the compiler error test.lhs:107:35: Couldn't match expected type `Char' against inferred type `[Char]' Expected type: String Inferred type: [String] In the second argument of `($)', namely `liftIO $ pageContent page' In the expression: jsonScalar $ liftIO $ pageContent page Failed, modules loaded: none. I'd appreciate a discussion about why this is wrong, and perhaps clues as to what is right. Last problem, stemming
Re: [Haskell-cafe] windows network programming
I tried this as an example and got the following error when running. net.exe: connect: failed (Connection refused (WSAECONNREFUSED)) Firewall is off, running as administrator Windows is Windows 7 Enterprise. Advice on what to do next is appreciated On Tue, Nov 2, 2010 at 1:24 PM, Nils Schweinsberg m...@n-sch.de wrote: Am 02.11.2010 19:57, schrieb Michael Litchard: got any urls with examples? Sure, see this short server-client-ping-pong application. By the way, I noticed that you don't need withSocketsDo on windows 7, but I guess it's there for a reason for older windows versions. :) import Control.Concurrent import Network import System.IO main :: IO () main = withSocketsDo $ do forkIO waitAndPong ping -- The basic server waitAndPong :: IO () waitAndPong = do socket - listenOn (PortNumber 1234) (handle,_,_) - accept socket hSetBuffering handle LineBuffering incoming - hGetLine handle putStrLn ( ++ incoming) hPutStrLn handle pong -- The basic client ping :: IO () ping = do handle - connectTo localhost (PortNumber 1234) hSetBuffering handle LineBuffering hPutStrLn handle ping incoming - hGetLine handle putStrLn ( ++ incoming) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] windows network programming
freenode figured this out. Pasting here for future reference. import Control.Concurrent import Network import System.IO main :: IO () main = withSocketsDo $ do m - newEmptyMVar forkIO (waitAndPong m) ping m -- The basic server waitAndPong :: MVar () - IO () waitAndPong m = do socket - listenOn (PortNumber 8000) putMVar m () (handle,_,_) - accept socket hSetBuffering handle LineBuffering incoming - hGetLine handle putStrLn ( ++ incoming) hPutStrLn handle pong -- The basic client ping :: MVar () - IO () ping m = do _ - takeMVar m handle - connectTo localhost (PortNumber 8000) hSetBuffering handle LineBuffering hPutStrLn handle ping incoming - hGetLine handle putStrLn ( ++ incoming) On Thu, Jan 20, 2011 at 6:17 PM, Michael Litchard mich...@schmong.orgwrote: I tried this as an example and got the following error when running. net.exe: connect: failed (Connection refused (WSAECONNREFUSED)) Firewall is off, running as administrator Windows is Windows 7 Enterprise. Advice on what to do next is appreciated On Tue, Nov 2, 2010 at 1:24 PM, Nils Schweinsberg m...@n-sch.de wrote: Am 02.11.2010 19:57, schrieb Michael Litchard: got any urls with examples? Sure, see this short server-client-ping-pong application. By the way, I noticed that you don't need withSocketsDo on windows 7, but I guess it's there for a reason for older windows versions. :) import Control.Concurrent import Network import System.IO main :: IO () main = withSocketsDo $ do forkIO waitAndPong ping -- The basic server waitAndPong :: IO () waitAndPong = do socket - listenOn (PortNumber 1234) (handle,_,_) - accept socket hSetBuffering handle LineBuffering incoming - hGetLine handle putStrLn ( ++ incoming) hPutStrLn handle pong -- The basic client ping :: IO () ping = do handle - connectTo localhost (PortNumber 1234) hSetBuffering handle LineBuffering hPutStrLn handle ping incoming - hGetLine handle putStrLn ( ++ incoming) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Question concerning Network.Curl.Opts
I'm having trouble passing header strings properly, and I'd like some advice on how to proceed. Below is a capture of what is being sent, versus what I am trying to send. I won't include all code, only what I think is necessary. If I have omitted something important, please let me know. How could I discover what the cause of the discrepancy is? Thanks again for any feedback. Here's a snippet from the header, what is being sent. GET /resourceList.do?form=webForwardsFormreadOnly=falsepolicyLaunching=trueresourcePrefix=webForwardspath=%2FshowWebForwards.domessageResourcesKey=webForwardsactionPath=%2FresourceList.do HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) Host: 172.16.1.18 Accept: */* Accept-Encoding: gzip,deflate Referer: https://172.16.1.18/showWebForwards.do Cookie: domainLogonTicket=SLXa10225c6e8389b3eb181e3df5dcf08de; logonTicket=SLXa10225c6e8389b3eb181e3df5dcf08de; lbTrack=OAIAGHMWQDOLYYTJEXQHXBYPXVALXNREKIHAYYRZSOGYJLUYNNCJ; SSLX_SSESHID=bvgx4mggmy6v ^ compare this to CurlHttpHeaders Here's the part of the source I think is relevant launch :: String - String - IO (Either String String) launch user pass = do -- Initialize Curl curl - initCurl -- Sequence of steps let steps = do curlResp curl urlInitial method_GET curlResp curl urlLogin $ loginOpts user pass curlResp curl urlFlash1 method_GET curlResp curl urlFlash2 method_GET curlResp curl urlGetResource resourceOpts here's where the problem is revealed runErrorT steps main :: IO () main = do -- username and password user:pass:_ - getArgs -- Launch webpage resp - launch user pass -- Response comes as Either String String -- You have to handle each case case resp of Left err - print err Right body - putStrLn body resourceOpts :: [CurlOption] resourceOpts = [ CurlHttpHeaders [ Accept text/javascript, text/html, application/xml, text/xml, */* , Accept-Language en-us,en;q=0.5 , Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 , Keep-Alive 115 , Connection keep-alive , X-Requested-WithXMLHttpRequest , X-Prototype-Version 1.6.0.3 ] , CurlEncoding gzip,deflate , CurlReferer https://172.16.1.18/showWebForwards.do; ] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] questions about network.curl/ web client programming
I'm learning both haskell and web programming as I go here, this question entails both. I'm writing a screen scraping program, and I'm at the point where I need to send certain data in the header. My question is, is that what method_HEADER is for? If so, could I see an example? If not, how does one go about shaping header data? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ghci seg faulting, have no idea why.
this just started happening, don't know why. Could anyone offer suggestions, troubleshooting methods? ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Segmentation fault ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ghci seg faulting, have no idea why.
Linux kether 2.6.26-2-xen-amd64 #1 SMP Thu Sep 16 16:32:15 UTC 2010 x86_64 GNU/Linux This was working fine for quite awhile, then broke. Also, I already tried removing the .ghc directory On Wed, Jan 12, 2011 at 6:16 PM, Antoine Latter aslat...@gmail.com wrote: What operating system/cpu are you using? On Jan 12, 2011 8:08 PM, Michael Litchard mich...@schmong.org wrote: this just started happening, don't know why. Could anyone offer suggestions, troubleshooting methods? ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Segmentation fault ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ghci seg faulting, have no idea why.
Oh, and the distro would be Debian (whatever the latest stable is) On Wed, Jan 12, 2011 at 7:10 PM, Michael Litchard mich...@schmong.orgwrote: Linux kether 2.6.26-2-xen-amd64 #1 SMP Thu Sep 16 16:32:15 UTC 2010 x86_64 GNU/Linux This was working fine for quite awhile, then broke. Also, I already tried removing the .ghc directory On Wed, Jan 12, 2011 at 6:16 PM, Antoine Latter aslat...@gmail.comwrote: What operating system/cpu are you using? On Jan 12, 2011 8:08 PM, Michael Litchard mich...@schmong.org wrote: this just started happening, don't know why. Could anyone offer suggestions, troubleshooting methods? ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Segmentation fault ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ghci seg faulting, have no idea why.
ghc-pkg check seems fine On Wed, Jan 12, 2011 at 7:47 PM, Paulo Tanimoto ptanim...@gmail.com wrote: Nothing wrong from: $ ghc-pkg check ? On Wed, Jan 12, 2011 at 9:11 PM, Michael Litchard mich...@schmong.org wrote: Oh, and the distro would be Debian (whatever the latest stable is) On Wed, Jan 12, 2011 at 7:10 PM, Michael Litchard mich...@schmong.org wrote: Linux kether 2.6.26-2-xen-amd64 #1 SMP Thu Sep 16 16:32:15 UTC 2010 x86_64 GNU/Linux This was working fine for quite awhile, then broke. Also, I already tried removing the .ghc directory On Wed, Jan 12, 2011 at 6:16 PM, Antoine Latter aslat...@gmail.com wrote: What operating system/cpu are you using? On Jan 12, 2011 8:08 PM, Michael Litchard mich...@schmong.org wrote: this just started happening, don't know why. Could anyone offer suggestions, troubleshooting methods? ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Segmentation fault ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ghci seg faulting, have no idea why.
I believe I have found a solution and am posting the following two links for others who might be driven insane by this problem. (ghci worked, then didn't, then did, then didn't). Turns out it seems to be ghc's terminal bindings need some work. http://forums.gentoo.org/viewtopic-t-845199-view-previous.html?sid=93c638d029aac6ffe40df2c6b86684ce which led me here http://trac.haskell.org/haskeline/ticket/105 Thank you intarwebs, and haskell-cafe! tl;dr try changing your TERM environment variable to xterm. On Wed, Jan 12, 2011 at 8:18 PM, Michael Litchard mich...@schmong.orgwrote: ghc-pkg check seems fine On Wed, Jan 12, 2011 at 7:47 PM, Paulo Tanimoto ptanim...@gmail.comwrote: Nothing wrong from: $ ghc-pkg check ? On Wed, Jan 12, 2011 at 9:11 PM, Michael Litchard mich...@schmong.org wrote: Oh, and the distro would be Debian (whatever the latest stable is) On Wed, Jan 12, 2011 at 7:10 PM, Michael Litchard mich...@schmong.org wrote: Linux kether 2.6.26-2-xen-amd64 #1 SMP Thu Sep 16 16:32:15 UTC 2010 x86_64 GNU/Linux This was working fine for quite awhile, then broke. Also, I already tried removing the .ghc directory On Wed, Jan 12, 2011 at 6:16 PM, Antoine Latter aslat...@gmail.com wrote: What operating system/cpu are you using? On Jan 12, 2011 8:08 PM, Michael Litchard mich...@schmong.org wrote: this just started happening, don't know why. Could anyone offer suggestions, troubleshooting methods? ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Segmentation fault ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ghci 6.12.3 segfaults for reasons unknown to me.
mlitch...@kether:~/projects/perf/autoperf/session_creator/newtry2/strings$ ghci -v GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Glasgow Haskell Compiler, Version 6.12.3, for Haskell 98, stage 2 booted by GHC version 6.8.2 ghci was working a few weeks ago. I may have hidden a package or installed one to cause this segfault now. Could someone help me troubleshoot what is causing this? I did a stack trace but could not discern any useful info from it. Using binary package database: /usr/local/lib/ghc-6.12.3/package.conf.d/package.cache Using binary package database: /home/mlitchard/.ghc/x86_64-linux-6.12.3/package.conf.d/package.cache hiding package parsec-2.1.0.1 to avoid conflict with later version parsec-3.1.0 hiding package base-3.0.3.2 to avoid conflict with later version base-4.2.0.2 wired-in package ghc-prim mapped to ghc-prim-0.2.0.0-5da421112969a971aa3433fdf154b37a wired-in package integer-gmp mapped to integer-gmp-0.2.0.1-67f3940ec8fd509683668f40451c9ca1 wired-in package base mapped to base-4.2.0.2-cc69ae37cc080e111e11df0109986bd2 wired-in package rts mapped to builtin_rts wired-in package haskell98 mapped to haskell98-1.0.1.1-4d2891ad99eae334ff8234bcfbddce06 wired-in package template-haskell mapped to template-haskell-2.4.0.1-e9e9c63092746bd4a3f64cc37ddb1e06 wired-in package dph-seq mapped to dph-seq-0.4.0-5ed11291726022ff6bb22049478399e8 wired-in package dph-par mapped to dph-par-0.4.0-5a5a24e36763903b0b26f03d8d510a95 Hsc static flags: -static Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Segmentation fault ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: borked windows environment, want to start over
On Tue, Nov 16, 2010 at 4:39 PM, Michael Litchard mich...@schmong.org wrote: I think I may have borked things good using cygwin. I want to remove it and do a clean install of haskell platform w/out cygwin. What do I need to do to make sure all configuration files have been removed? Hmm, I wasn't precise enough in my question. My concern is there are configuration files related to the windows haskell-platform install that I don't know about , that need to be removed prior to doing a clean install. Or is it just a matter of doing a standard windows uninstall, will that take care of things? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] borked windows environment, want to start over
I think I may have borked things good using cygwin. I want to remove it and do a clean install of haskell platform w/out cygwin. What do I need to do to make sure all configuration files have been removed? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] RegEx versus (Parsec, TagSoup, others...)
I've been working on a project that requires me to do screen scraping. When I first started this, I worked off of other people's examples. Not one used regex. By luck I found someone at work to help me along this project. His clues and hints don't use regex either. I was at a point where I had to make a decision concerning design, so I asked the guy sitting next to me at work. He's very experienced, and comes from a Perl perspective. I let him into what I was doing, and he opined I should be using pcre. So now I'm second guessing my choices. Why do people choose not to use regex for uri parsing? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] windows network programming
got any urls with examples? On Tue, Nov 2, 2010 at 12:17 AM, Nils Schweinsberg m...@n-sch.de wrote: Am 02.11.2010 01:20, schrieb Paulo Tanimoto: http://hackage.haskell.org/package/network You just have to remember that you need to call withSocketsDo on windows before doing anything with the network library. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] trying to use Tag Soup - fromAttrib
I have the following TagOpen [TagOpen a [(href,/launchWebForward.do?resourceId=4policy=0returnTo=%2FshowWebForwards.do)]] I would like to get the attribute resourceId=4 from that. My understanding is that fromAttrib is the right thing to use. But I'm having difficulty understanding the type signature fromAttrib :: (Show str, Eq str, StringLike str) = str - Tag str - str I'm sure if I did, the way to use it would be clear. Could someone help me make sense of this? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] trying to use Tag Soup - fromAttrib
Daniel, Thank you for your reply. I'm still confused. When I see a code sample like this main = do posts - liftM parseTags (readFile posts.xml) print $ head $ map (fromAttrib Id) $ filter (~== (row OwnerUserId= ++ userid ++ )) posts I have no idea how to match that up with what you said. The usage of fromAttrib here doesn't match up with what I htink the type signature is saying. fromAttrib :: (Show str, Eq str, StringLike str) = str - Tag str - str seems to say fromAttrib takes two parameters (I know it doesn't literally take two), one str (with the constraints in parenthesis to the left) and one str of type Tag, giving back a str. Then I look at the above code sample and can't match the two up. On Tue, Nov 2, 2010 at 2:23 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: On Tuesday 02 November 2010 22:17:48, Michael Litchard wrote: I have the following TagOpen [TagOpen a [(href,/launchWebForward.do?resourceId=4policy=0returnTo=%2FshowWeb Forwards.do)]] I would like to get the attribute resourceId=4 from that. My understanding is that fromAttrib is the right thing to use. But I'm having difficulty understanding the type signature fromAttrib :: (Show str, Eq str, StringLike str) = str - Tag str - str I'm sure if I did, the way to use it would be clear. Could someone help me make sense of this? In most uses, str will be one of - String - ByteString - Text substitute the one you're using for str. I've no idea why there's a Show constraint (except perhaps it's needed for a failure message). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] trying to use Tag Soup - fromAttrib
Ah thank you. I can go ahead and figure out how to parse that string. Using a regex is tempting but I have a feeling I can get something more maintainable if I use another approach. On Tue, Nov 2, 2010 at 2:52 PM, Daniel Schoepe daniel.scho...@googlemail.com wrote: Excerpts from Michael Litchard's message of Tue Nov 02 22:40:27 +0100 2010: Daniel, Thank you for your reply. I'm still confused. When I see a code sample like this main = do posts - liftM parseTags (readFile posts.xml) print $ head $ map (fromAttrib Id) $ filter (~== (row OwnerUserId= ++ userid ++ )) posts I have no idea how to match that up with what you said. The usage of fromAttrib here doesn't match up with what I htink the type signature is saying. fromAttrib :: (Show str, Eq str, StringLike str) = str - Tag str - str seems to say fromAttrib takes two parameters (I know it doesn't literally take two), one str (with the constraints in parenthesis to the left) and one str of type Tag, giving back a str. Then I look at the above code sample and can't match the two up. In the code sample, the first argument is Id, in which case the concrete type for the type variable str is String, and the second argument are the tags returned by the call to filter, which have type Tag String. The second parameter is not a str of type Tag, but Tag (which is a type constructor) applied to the same concrete type for str its first argument has. So in your case, calling fromAttrib href (TagOpen ...) Would give you /launchWebForward.do?resourceId=4policy=0returnTo=%2FshowWebForwards.do. To get the resourceId you want, you'd have to dissect this string further. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] problems installing latest parsec
Here's what cabal says I have installed * parsec Synopsis: Monadic parser combinators Latest version available: 3.1.0 Latest version installed: 2.1.0.1 Homepage: http://www.cs.uu.nl/~daan/parsec.html License: BSD3 but here is what happens when I try to upgrade cabal upgrade parsec Resolving dependencies... No packages to be installed. All the requested packages are already installed. If you want to reinstall anyway then use the --reinstall flag. mlitch...@kether:~/projects/perf/autoperf/session_creator$ Any clues as to what I can try next to fix things would be appreciated. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] problems installing latest parsec
thanks, it seems to be fine now. On Tue, Nov 2, 2010 at 5:04 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: On Wednesday 03 November 2010 00:46:13, Michael Litchard wrote: Here's what cabal says I have installed * parsec Synopsis: Monadic parser combinators Latest version available: 3.1.0 Latest version installed: 2.1.0.1 Homepage: http://www.cs.uu.nl/~daan/parsec.html License: BSD3 but here is what happens when I try to upgrade cabal upgrade parsec Resolving dependencies... No packages to be installed. All the requested packages are already installed. If you want to reinstall anyway then use the --reinstall flag. mlitch...@kether:~/projects/perf/autoperf/session_creator$ Any clues as to what I can try next to fix things would be appreciated. $ cabal install parsec-3.1.0 There's a preferred version constraint on parsec, so by default cabal installs parsec-2 rather than parsec-3, you have to tell it explicitly to install parsec-3. It might be necessary to tell cabal to use parsec-3 also when installing other packages that depend on parsec, $ cabal install --constraint=parsec == 3.1.0 whatever should do the trick then (if it doesn't use the --preference flag instead of --constraint). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] windows network programming
I took a quick look on hackage for an interface to windows networking function calls, and didn't find anything that worked. I may have overlooked something. What's the state of windows network programming? Any recommendations for a good package? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] tried to use the example given in the source of network.browser
This is what is in HTTPbis/Network/Browser.hs do rsp - Network.Browser.browse $ do setAllowRedirects True -- handle HTTP redirects request $ getRequest http://google.com/; fmap (take 100) (getResponseBody rsp) And how I changed it slightly to test it out import Network.HTTP import Network.Browser main = do rsp - Network.Browser.browse $ do setAllowRedirects True -- handle HTTP redirects request $ getRequest http://google.com/; fmap (take 100) (getResponseBody rsp) but I got this errortest.lhs:10:39: Couldn't match expected type `Network.Stream.Result (Response [a])' against inferred type `(Network.URI.URI, Response String)' In the first argument of `getResponseBody', namely `rsp' In the second argument of `fmap', namely `(getResponseBody rsp)' In the expression: fmap (take 100) (getResponseBody rsp) how did I get this error? I'm perplexed as this came right from the source. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] playing around with network.curl - redub
My current problem is how to pass around the cookie jar. I need to gather cookies, while establishing a session. Could someone provide an example? I've messed about with CurlCookieFile and CurlCookieJar, to no avail. I'll provide my failed attempt if needed. I'm using https, if it makes a difference. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] suspected problem with network.curl version 1.3.5
Here's my code, I'm pretty sure I am doing this right. The problem seems to be with method_POST. I tried to duplicate manually, but I'm not sure I used command line curl correctly. Take a look at the output below. import Network.Curl import System (getArgs) import Text.Regex.Posix -- | Standard options used for all requests. Uncomment the @CurlVerbose@ -- option for lots of info on STDOUT. opts = [ CurlCookieJar cookies , CurlVerbose True ] -- | Additional options to simulate submitting the login form. loginOptions user pass = CurlPostFields [ login= ++ user, password= ++ pass ] : method_POST main = withCurlDo $ do -- Get username and password from command line arguments (will cause -- pattern match failure if incorrect number of args provided). [user, pass] - getArgs -- Initialize curl instance. curl - initialize setopts curl opts -- POST request to login. r - do_curl_ curl https://github.com/login; (loginOptions user pass) :: IO CurlResponse if respCurlCode r /= CurlOK || respStatus r /= 200 then error $ Failed to log in: ++ show (respCurlCode r) ++ -- ++ respStatusLine r else do -- GET request to fetch account page. r - do_curl_ curl (https://github.com/session;) method_GET :: IO CurlResponse if respCurlCode r /= CurlOK || respStatus r /= 200 then error $ Failed to retrieve account page: ++ show (respCurlCode r) ++ -- ++ respStatusLine r else putStrLn $ extractToken $ respBody r -- | Extracts the token from GitHub account HTML page. extractToken body = head' GitHub token not found xs where head' msg l = if null l then error msg else head l (_,_,_,xs) = body =~ github\\.token (.+) :: (String, String, String,[String]) * About to connect() to github.com port 443 (#0) * Trying 207.97.227.239... * connected * Connected to github.com (207.97.227.239) port 443 (#0) * found 142 certificates in /etc/ssl/certs/ca-certificates.crt *server certificate verification SKIPPED *common name: *.github.com (matched) *server certificate expiration date OK *server certificate activation date OK *certificate public key: RSA *certificate version: #3 *subject: O=*.github.com,OU=Domain Control Validated,CN=*.github.com *start date: Fri, 11 Dec 2009 05:02:36 GMT *expire date: Thu, 11 Dec 2014 05:02:36 GMT *issuer: C=US,ST=Arizona,L=Scottsdale,O=GoDaddy.com\, Inc.,OU=http://certificates.godaddy.com/repository,CN=Go Daddy Secure Certification Authority,serialNumber=07969287 *compression: NULL *cipher: AES-128-CBC *MAC: SHA1 GET /login HTTP/1.1 Host: github.com Accept: */* snip See, the code set a GET, where I thought I was doing a POST here is my attempt to do a POST manually, it failed but I'm not sure it's right. curl --data authenticity_token=BigAssTokenlogin=UserNamepassword=Passwordcommit=Log+in https://github.com/login login_out anyway, could someone try to replicate this problem? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] playing around with network.curl
I'm using this tutorial as a guide http://flygdynamikern.blogspot.com/2009/03/extended-sessions-with-haskell-curl.html github has changed since this was posted, but I have managed a successful login. Now I am faced with dealing with a re-direct. I found this constructor CurlFollowLocation Bool on this page http://hackage.haskell.org/packages/archive/curl/1.3.5/doc/html/Network-Curl-Opts.html It seems to do what I want, But I am not clear on how to use it. Could someone provide an example? Thanks. End goal is to snarf the cookie that establishes the session. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] playing around with network.curl
constructor fixes that problem, but I am left with the problem I began with. import Network.Curl import System (getArgs) import Text.Regex.Posix -- | Standard options used for all requests. Uncomment the @CurlVerbose@ -- option for lots of info on STDOUT. opts = [ CurlCookieJar cookies , CurlVerbose True, CurlFollowLocation True] -- | Additional options to simulate submitting the login form. loginOptions user pass = CurlPostFields [ login= ++ user, password= ++ pass ] : method_POST main = withCurlDo $ do -- Get username and password from command line arguments (will cause -- pattern match failure if incorrect number of args provided). [user, pass] - getArgs -- Initialize curl instance. curl - initialize setopts curl opts -- POST request to login. r - do_curl_ curl https://github.com/session; (loginOptions user pass) :: IO CurlResponse if respCurlCode r /= CurlOK || respStatus r /= 302 then error $ Failed to log in: ++ show (respCurlCode r) ++ -- ++ respStatusLine r else do -- GET request to fetch account page. r - do_curl_ curl (https://github.com/account;) method_GET :: IO CurlResponse if respCurlCode r /= CurlOK || respStatus r /= 302 then error $ Failed to retrieve account page: ++ show (respCurlCode r) ++ -- ++ respStatusLine r else putStrLn $ extractToken $ respBody r -- | Extracts the token from GitHub account HTML page. extractToken body = head' GitHub token not found xs where head' msg l = if null l then error msg else head l (_,_,_,xs) = body =~ github\\.token (.+) :: (String, String, String,[String]) On Wed, Oct 20, 2010 at 4:33 PM, Paulo Tanimoto ptanim...@gmail.com wrote: Hi Michael, On Wed, Oct 20, 2010 at 6:19 PM, Michael Litchard mich...@schmong.org wrote: I'm using this tutorial as a guide http://flygdynamikern.blogspot.com/2009/03/extended-sessions-with-haskell-curl.html github has changed since this was posted, but I have managed a successful login. Now I am faced with dealing with a re-direct. I found this constructor CurlFollowLocation Bool on this page http://hackage.haskell.org/packages/archive/curl/1.3.5/doc/html/Network-Curl-Opts.html It seems to do what I want, But I am not clear on how to use it. Could someone provide an example? Thanks. End goal is to snarf the cookie that establishes the session. I think it is what you're probably expecting. Just add CurlFollowLocation True to the list of options. Those get applied by setopts in main. opts = [ CurlCookieJar cookies, CurlFollowLocation True ] I've used that before with no problems. Do you need a complete example? Paulo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] help me evangelize haskell.
I'll be starting a new job soon as systems tool guy. The shop is a perl shop as far as internal automation tasks go. But I am fortunate to not be working with bigots. If they see a better way, they'll take to it. So please give me your best arguments in favor of using haskell for task automation instead of perl, or awk or any of those scripting lanugages. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] help me evangelize haskell.
I will be going into a situation where there are tasks that have yet to be automated, so I will be going after that before re-writing anything. But if I can come up with here's why, there will be less eyebrows raised. Thanks for all feedback so far. On Sat, Sep 4, 2010 at 10:21 AM, Gaius Hammond ga...@gaius.org.uk wrote: My usual rhetoric is that one-off, throwaway scripts never are, and not only do they tend to stay around but they take on a life of their own. Today's 10-line file munger is tomorrow's thousand-line ETL batch job on which the business depends for some crucial data - yet the original author is long gone and no-one dares modify in case it breaks. So it is just good sense to use sound practices from the very beginning. One of the features of Perl is that it will try to work even if you make type errors (e.g. give it a scalar in place of a list, or a string instead of an int). One day, however, it WILL fail. Haskell finds these types of bugs upfront, and not when your pager goes off at 3am... Cheers, G --Original Message-- From: Michael Litchard Sender: haskell-cafe-boun...@haskell.org To: haskell-cafe@haskell.org Subject: [Haskell-cafe] help me evangelize haskell. Sent: Sep 4, 2010 17:38 I'll be starting a new job soon as systems tool guy. The shop is a perl shop as far as internal automation tasks go. But I am fortunate to not be working with bigots. If they see a better way, they'll take to it. So please give me your best arguments in favor of using haskell for task automation instead of perl, or awk or any of those scripting lanugages. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Warning: Module `Prelude' is deprecated:
So lately when I use cabal to install something get Text/CSV.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. how do I implement cabal's advice? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] feasability of implementing an awk interpreter.
Thank you all for your encouragement. I need to think about the core functionality, and do some reading. On Fri, Aug 20, 2010 at 2:33 AM, Josef Svenningsson josef.svennings...@gmail.com wrote: On Fri, Aug 20, 2010 at 6:05 AM, Jason Dagit da...@codersbase.com wrote: On Thu, Aug 19, 2010 at 8:05 PM, Michael Litchard mich...@schmong.org wrote: I'd like the community to give me feedback on the difficulty level of implementing an awk interpreter. What language features would be required? Specifically I'm hoping that TH is not necessary because I'm nowhere near that skill level. Implementing an awk interpreter in Haskell can be a fun project. I have a half finished implementation lying around on the hard drive. It's perfectly possible to implement it without using any super fancy language features. But as other people have pointed out, monads are helpful for dealing with a lot of the plumbing in the interpreter. An outline of a possible approach would be appreciated. I am using http://www.math.utah.edu/docs/info/gawk_toc.html as a guide to the language description. You might also focus on the 'core' of awk. Think about, what is the minimal language and start from there. Grow your implementation adding features bit by bit. It's also a good opportunity to do testing. You have a reference implementation and so you can write lots of tests for each feature as you add them. When I wrote my awk interpreter I decided to go for the whole language from start. I had reasons for doing this as there were certain aspects of this that I wanted to capture but it is not they way I would recommend going about it. I definitely second Jason's advice at trying to capture the core functionality first. Have fun, Josef ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] feasability of implementing an awk interpreter.
I'd like the community to give me feedback on the difficulty level of implementing an awk interpreter. What language features would be required? Specifically I'm hoping that TH is not necessary because I'm nowhere near that skill level. An outline of a possible approach would be appreciated. I am using http://www.math.utah.edu/docs/info/gawk_toc.html as a guide to the language description. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] unusual behavior from cabal
Not sure what the correct list is for this observation. I was trying to install gitit, and here is what happened. mich...@michael:~/haskell/blog-example$ cabal install gitit Resolving dependencies... cabal: dependencies conflict: happstack-server-0.5.1 requires time ==1.1.4 however time-1.1.4 was excluded because happstack-server-0.5.1 requires time ==1.2.0.3 huh? Cabal seems to think happstack-server-0.5.1 has two conflicting requirements. How do I suss this out? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] offtopic - installing archlinux as a domU
I know some haskell people out there have done what I am trying to do, and I hope you can help me out. I've got access to a debian server which is running a Xen Hypervisor 3.0.3 I believe. I would like to install archlinux as a paravirtual machine (or HVM if I must) in order to get a more supportive haskell environment than my current OS. Could someone point me to some updated documentation on this process? Much thanks. Michael Litchard ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] astronomy projects in haskell
I remember reading some website, that dons (probably) posted once. I'd like to find them again for a report I'm doing. So, if you know of any astronomy websites that talk about projects using haskell, please let me know. thanks Michael Litchard ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [Haskell] Google Summer of Code 2009
I would love a mentor to help me with a Haskell binding to libnova. This is part of a larger project I have in mind, but the libnova binding seems like the first step. I don't expect this to be picked as an official GSoC, but this seemed like a good time to look for a mentor for this project. Michael Litchard On Tue, Feb 10, 2009 at 6:26 AM, Malcolm Wallace malcolm.wall...@cs.york.ac.uk wrote: Gentle Haskellers, The Google Summer of Code will be running again this year. Once again, haskell.org has the opportunity to bid to become a mentoring organisation. (Although, as always, there is no guarantee of acceptance.) If you have ideas for student projects that you think would benefit the Haskell community, now is the time to start discussing them on mailing lists of your choice. We especially encourage students to communicate with the wider community: if you keep your ideas private, you have a much worse chance of acceptance than if you develop ideas in collaboration with those who will be your customers, end-users, or fellow-developers. This is the open-source world! The timeline is that Haskell.org will apply for GSoC membership between 9-13 March, and if we are successful, students can submit applications between 23 March - 3 April. If you wish to help publicise GSoC amongst students, there are official posters/fliers available (not specific to haskell.org): http://code.google.com/p/google-summer-of-code/wiki/GsocFlyers Regards, Malcolm ___ Haskell mailing list hask...@haskell.org http://www.haskell.org/mailman/listinfo/haskell ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Graham-Scan Algorithm exercise from Chapter 3 Real World Haskell
I have started the Graham Scan Algorithm exercise. I'm getting tripped up by the sortByCotangent* function. Here's what I have so far data Direction = DStraight | DLeft | DRight deriving (Eq,Show) type PointXY = (Double,Double) calcTurn :: PointXY - PointXY - PointXY - Direction calcTurn a b c | crossProduct == 0 = DStraight | crossProduct 0 = DLeft | otherwise = DRight where crossProduct = ((fst b - fst a) * (snd c - snd a)) - ((snd b - snd a) * (fst c - fst a)) calcDirectionList :: [PointXY] - [Direction] calcDirectionList (x:y:z:zs) = (calcTurn x y z) : (calcDirectionList (y:z:zs)) calcDirectionList _ = [] sortListByY :: [PointXY] - [PointXY] sortListByY [] = [] sortListByY [a] = [a] sortListByY (a:as) = insert (sortListByY as) where insert [] = [a] insert (b:bs) | snd a = snd b = a : b : bs | otherwise = b : insert bs sortListByCoTangent :: [PointXY] - [PointXY] sortListByCoTangent [] = [] sortListByCoTangent [a] = [a] sortListByCoTangent (a:as) = a : insert (sortListByCoTangent as) where insert :: [PointXY] - [PointXY] insert [] = [a] insert [b] = [b] insert (b:c:cs) | (myCoTan a b) = (myCoTan a c) = b : c : cs | otherwise = c : b : insert cs where myCoTan :: PointXY - PointXY - Double myCoTan p1 p2 = (fst p2 - fst p1) / (snd p2 - snd p1) test data *Main sortListByCoTangent (sortListByY [(1,2),(2,6),(3,10),(4,9),(5,10),(2,20),(6,15)]) [(1.0,2.0),(5.0,10.0),(2.0,6.0),(4.0,9.0),(6.0,15.0),(3.0,10.0),(2.0,20.0)] (1,0,2.0) is correct. That's the pivot point. It screws up from there. I suspect my insert is hosed, but I'm having difficulty analyzing the logic of the code. I'd like hints/help but with the following boundaries. (1) I want to stick with the parts of the language that's been introduced in the text so far. I know there are solutions that make this problem trivial, however using those misses the point. (2) I'd prefer going over the logic of my code, versus what is supposed to happen. I'm trying to learn how to troubleshoot haskell code, more than implement the graham scan algorithm. I appreciate any help/hints Michael Litchard *It seems the wikipedia page on the graham scan algorithm is wrong concerning the following part of the algorithm. ...instead, it suffices to calculate the tangent of this angle, which can be done with simple arithmetic. Someone from #haskell said that it's the cotangent I want, and my math tutor confirmed. If this is the case, I suppose we should submit a correction. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe