Re: [Haskell-cafe] Network.Curl cookie jar madness

2012-08-18 Thread Michael Orlitzky
On 08/18/2012 08:52 PM, Michael Orlitzky wrote: > I'm one bug away from a working program and need some help. I wrote a > little utility that logs into LWN.net, retrieves an article, and creates > an epub out of it. I've created two pages where anyone can test this. The first just takes any userna

[Haskell-cafe] Predictive parser combinators need four values to report errors

2012-08-18 Thread John Lask
I am unable to find a copy of the following paper: Andrew Partridge, David Wright: Predictive parser combinators need four values to report errors. Journal of Functional Programming 6(2): 355-364, 1996 does any one have a copy of, that they could send me ? __

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-18 Thread wren ng thornton
On 8/17/12 11:28 AM, Leon Smith wrote: And the difference between reactionary and proactive approaches I think is a potential justification for the "hard" and "soft" upper bounds; perhaps we should instead call them "reactionary" and "proactive" upper bounds instead. I disagree. A hard constra

Re: [Haskell-cafe] phantom types

2012-08-18 Thread wren ng thornton
On 8/17/12 5:35 AM, TP wrote: Hi, I am currently reading documentation on Generalized Algebraic Data Types: http://en.wikibooks.org/wiki/Haskell/GADT I have a question concerning this page. Let us consider the following code proposed in the page: -- -- Phantom

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-18 Thread wren ng thornton
On 8/17/12 12:54 AM, Alexander Solla wrote: On Thu, Aug 16, 2012 at 8:07 PM, wren ng thornton wrote: Though bear in mind we're discussing second-order quantification here, not first-order. Can you expand on what you mean here? I don't see two kinds of quantification in the type language (at

Re: [Haskell-cafe] Network.Curl cookie jar madness

2012-08-18 Thread Michael Orlitzky
On 08/18/2012 09:00 PM, Iustin Pop wrote: > On Sat, Aug 18, 2012 at 08:52:00PM -0400, Michael Orlitzky wrote: >> >> Curl is making the request, but if I remove the (hPutStrLn stderr >> response_body), it doesn't work! What's even more insane is, this works: >> >> hPutStrLn stderr response_body >>

Re: [Haskell-cafe] Network.Curl cookie jar madness

2012-08-18 Thread Iustin Pop
On Sat, Aug 18, 2012 at 08:52:00PM -0400, Michael Orlitzky wrote: > I'm one bug away from a working program and need some help. I wrote a > little utility that logs into LWN.net, retrieves an article, and creates > an epub out of it. Full code here: > > git clone http://michael.orlitzky.com/git/

[Haskell-cafe] Network.Curl cookie jar madness

2012-08-18 Thread Michael Orlitzky
I'm one bug away from a working program and need some help. I wrote a little utility that logs into LWN.net, retrieves an article, and creates an epub out of it. Full code here: git clone http://michael.orlitzky.com/git/lwn-epub.git This is the code that gets the login cookie: cj <- make_coo

Re: [Haskell-cafe] Adding to / subtracting from a LocalTime?

2012-08-18 Thread Adde Nilsson
Didn't know, thanks. Back in Haskell land my conclusion is that if you're planning on doing pure date calculations you have to pass a TimeZone as well. /Adde On Sun, Aug 19, 2012 at 12:11 AM, Brandon Allbery wrote: > On Sat, Aug 18, 2012 at 6:05 PM, Adde Nilsson wrote: > >> Ok, do you know of a

Re: [Haskell-cafe] Adding to / subtracting from a LocalTime?

2012-08-18 Thread Brandon Allbery
On Sat, Aug 18, 2012 at 6:05 PM, Adde Nilsson wrote: > Ok, do you know of any way to add/subtract without converting to UTC and > back? I'm not sure I'd do that in any environment, since usually libraries don't deal with the result crossing a daylight/summer time change (and those that do, surp

Re: [Haskell-cafe] Adding to / subtracting from a LocalTime?

2012-08-18 Thread Adde Nilsson
Ok, do you know of any way to add/subtract without converting to UTC and back? On Sat, Aug 18, 2012 at 7:53 PM, Paolino wrote: > Hello. > > This is a part of a solution, with explicit TimeZone > > Prelude Data.Time> :t \z s t -> utcToLocalTime z $ addUTCTime > (fromIntegral s) (localTimeToUTC z

Re: [Haskell-cafe] 3 level hierarchy of Haskell objects

2012-08-18 Thread Jay Sulzberger
When I was last on the best rooftop in the Mid Upper West Side of Manhattan I was told of the work on logical relations. I did not know of this three decades old line of work. I have grabbed http://homepages.inf.ed.ac.uk/gdp/publications/Par_Poly.pdf To me, the style is comfortable and the mat

Re: [Haskell-cafe] Flipping type constructors

2012-08-18 Thread Erik Hesselink
The next version of GHC will have an extension for kind polymorphism. I'm not sure if it has to be enabled in the module that defines flip or in the module that uses it, but it might help. Erik On Tue, Aug 14, 2012 at 1:38 AM, Tony Morris wrote: > I have a data-type that is similar to EitherT, h

Re: [Haskell-cafe] Does someone have a compiled binary of the LLVM for Windows 7 or must one compile the source?

2012-08-18 Thread KC
Thank you It involves going to - \cabal\packages\hackage.haskell.org\repa-algorithms\3.2.1.1\repa-algorithms-3.2.1.1 - making the cabal file changes - re-tar-ing - re-gzip-ing On Wed, Aug 15, 2012 at 6:29 PM, Ivan Lazar Miljenovic wrote: > On 16 August 2012 11:21, KC wrote: >> I just want

Re: [Haskell-cafe] Adding to / subtracting from a LocalTime?

2012-08-18 Thread Paolino
Hello. This is a part of a solution, with explicit TimeZone Prelude Data.Time> :t \z s t -> utcToLocalTime z $ addUTCTime (fromIntegral s) (localTimeToUTC z t) \z s t -> utcToLocalTime z $ addUTCTime (fromIntegral s) (localTimeToUTC z t) :: Integral a => TimeZone -> a -> LocalTime -> LocalTime

[Haskell-cafe] Adding to / subtracting from a LocalTime?

2012-08-18 Thread Adde Nilsson
Hi. How do you add to or subtract from a LocalTime? I'm trying to subtract a second from a LocalTime value but the only API's I can find act only on the TimeOfDay part. subSec :: LocalTime -> LocalTime subSec (LocalTime d t) = LocalTime d $ timeToTimeOfDay ((timeOfDayToTime t) - (secondsToDiffTime

[Haskell-cafe] regex-pcre is not working with UTF-8

2012-08-18 Thread José Romildo Malaquias
Hello. It seems that the regex-pcre has a bug dealing with utf-8: Prelude> :m + Text.Regex.PCRE Prelude Text.Regex.PCRE> "país:Brasil" =~ "país:(.*)" :: (String,String,String,[String]) ("","pa\237s:Brasil","",["rasil"]) Notice the missing 'B' in the result of the regex matching. With

Re: [Haskell-cafe] Regex string replacement

2012-08-18 Thread José Romildo Malaquias
On Sat, Aug 18, 2012 at 09:39:01AM -0300, Marco Túlio Pimenta Gontijo wrote: > Hi Romildo. > > On Sat, Aug 18, 2012 at 9:18 AM, José Romildo Malaquias > wrote: > (...) > > I am looking for a substring replacement based on Perl like regular > > expressions that would let me use part of the origina

Re: [Haskell-cafe] Regex string replacement

2012-08-18 Thread Marco Túlio Pimenta Gontijo
Hi Romildo. On Sat, Aug 18, 2012 at 9:18 AM, José Romildo Malaquias wrote: (...) > I am looking for a substring replacement based on Perl like regular > expressions that would let me use part of the original string in the > replacement string. Something like: > >reReplace "name is (.*)\\." "h

[Haskell-cafe] Regex string replacement

2012-08-18 Thread José Romildo Malaquias
Hello. I am looking for a substring replacement based on Perl like regular expressions that would let me use part of the original string in the replacement string. Something like: reReplace "name is (.*)\\." "hi \1!" "my name is john." which would result in "hy john!" Any help? Romildo

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-18 Thread David Feuer
On Thu, Aug 16, 2012 at 9:53 AM, Felipe Almeida Lessa wrote: > If you import qualified then adding functions will never break anything. If the language is changed (without possibility of breakage, I believe) so that names declared in a module shadow imported names, incompatibility can only arise