Re: [Haskell-cafe] Contributing to http-conduit

2012-01-24 Thread Michael Snoyman
On Wed, Jan 25, 2012 at 9:01 AM, Myles C. Maxfield wrote: > Sorry, I think I'm still a little confused about this. > > From the point of view of a library user, if I use the 'http' function, but > want to know what final URL I ended up at, I would have to set redirects to > 0, call http, call chec

Re: [Haskell-cafe] Contributing to http-conduit

2012-01-24 Thread Myles C. Maxfield
Sorry, I think I'm still a little confused about this. >From the point of view of a library user, if I use the 'http' function, but want to know what final URL I ended up at, I would have to set redirects to 0, call http, call checkRedirect, and recurse until checkRedirect returns Nothing (or a co

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread David Laing
Hi all, Just to add to the list - Qt Creator contains a pretty nice (and incremental) C++ parser. Cheers, Dave On Wed, Jan 25, 2012 at 5:06 AM, Stephen Tetley wrote: > There is also the DMS from Ira Baxter's company Semantic Design's. > This is an industry proven refactoring framework that han

Re: [Haskell-cafe] Contributing to http-conduit

2012-01-24 Thread Michael Snoyman
It would be the new request indicated by the server response, if the server gave a redirect response. On Tue, Jan 24, 2012 at 9:05 PM, Myles C. Maxfield wrote: > Sorry, I don't think I'm following. What would the meaning of the value > returned from checkRedirect be? > > --Myles > > > On Tue, Jan

[Haskell-cafe] XMonad.Shell.Prompt and unicode input

2012-01-24 Thread Eugene Dzhurinsky
Hello, community! I have some strange issue with recent XMonad: with using of standard Shell module it is not possible to use unicode input. It simply freezes up and in console I can observe: Enum.toEnum{Word8} : tag (1092) is outside of bounds (0,255). What function may cause such error indirec

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-24 Thread Felipe Almeida Lessa
Really nice! Looks like it could be a useful mini-package on Hackage. -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-24 Thread HASHIMOTO, Yusaku
Great, It illustrates why difference lists are awesome. import HTrace app :: [a] -> [a] -> [a] app [] ys = htrace "app" ys app (x:xs) ys = htrace "app" (x:app xs ys) rev1 [] = htrace "[]" [] rev1 (x:xs) = htrace "rev1" (app (rev1 xs) [x]) rev2 []     ys = htrace "ys" ys rev2 (x:xs) ys = htrace

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-24 Thread Chris Wong
>> I like  let (hd, _ : tl) = break prd lst in... > > Oh, wait.  That won't always work. :( > second (drop 1) . break prd list? :) > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-24 Thread David Fox
On Tue, Jan 24, 2012 at 1:00 PM, David Fox wrote: > On Mon, Jan 23, 2012 at 1:01 PM, Joey Hess wrote: > >>> >   Other stuff: >>> > >>> >   separate :: (a -> Bool) -> [a] -> ([a], [a]) >>> >>> Is this partition from Data.List? >> >> No; it's like break but does not include the separating character

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-24 Thread David Fox
On Mon, Jan 23, 2012 at 1:01 PM, Joey Hess wrote: >> >   Other stuff: >> > >> >   separate :: (a -> Bool) -> [a] -> ([a], [a]) >> >> Is this partition from Data.List? > > No; it's like break but does not include the separating character in the > snd list. I like let (hd, _ : tl) = break prd lst

Re: [Haskell-cafe] Contributing to http-conduit

2012-01-24 Thread Aristid Breitkreuz
Yeah, a more combinatorial approach to making HTTP requests would be good. So +1 for checkRedirect or anything similar. 2012/1/24 Michael Snoyman : > On Tue, Jan 24, 2012 at 6:57 PM, Myles C. Maxfield > wrote: >> >> On Mon, Jan 23, 2012 at 10:43 PM, Michael Snoyman >> wrote: >>> >>> On Tue, Jan

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Stephen Tetley
There is also the DMS from Ira Baxter's company Semantic Design's. This is an industry proven refactoring framework that handles C++ as well as other languages. I think the Antlr C++ parser may have advanced since the article Antoine Latter link to, but personally I'd run a mile before trying to d

Re: [Haskell-cafe] Contributing to http-conduit

2012-01-24 Thread Myles C. Maxfield
Sorry, I don't think I'm following. What would the meaning of the value returned from checkRedirect be? --Myles On Tue, Jan 24, 2012 at 10:47 AM, Michael Snoyman wrote: > On Tue, Jan 24, 2012 at 6:57 PM, Myles C. Maxfield > wrote: > > > > On Mon, Jan 23, 2012 at 10:43 PM, Michael Snoyman > > w

Re: [Haskell-cafe] Contributing to http-conduit

2012-01-24 Thread Michael Snoyman
On Tue, Jan 24, 2012 at 6:57 PM, Myles C. Maxfield wrote: > > On Mon, Jan 23, 2012 at 10:43 PM, Michael Snoyman > wrote: >> >> On Tue, Jan 24, 2012 at 8:37 AM, Myles C. Maxfield >> wrote: >> > I have attached a patch to add a redirect chain to the Response >> > datatype. >> > Comments on this pa

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Nathan Howell
On Tue, Jan 24, 2012 at 2:06 AM, Christopher Brown wrote: > I have stumbled across language-c on hackage and I was wondering if anyone > is aware if there exists a full C++ parser written in Haskell? > Check out clang: http://clang.llvm.org/ and http://hackage.haskell.org/package/LibClang The cl

Re: [Haskell-cafe] Contributing to http-conduit

2012-01-24 Thread Myles C. Maxfield
On Mon, Jan 23, 2012 at 10:43 PM, Michael Snoyman wrote: > On Tue, Jan 24, 2012 at 8:37 AM, Myles C. Maxfield > wrote: > > I have attached a patch to add a redirect chain to the Response datatype. > > Comments on this patch are very welcome. > > I thought that this isn't necessary since a client

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Jason Dagit
On Tue, Jan 24, 2012 at 8:40 AM, Christopher Brown wrote: > Hi Jason, > > Thanks very much for you thoughtful response. > > I am intrigued about the Happy route: as I have never really used Happy > before, am I right in thinking I could take the .gr grammar, feed it into > Happy to generate a pa

[Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-24 Thread Eugene Kirpichov
Hi cafe, Look how one can watch the evaluation tree of a computation, to debug laziness-related problems. {-# LANGUAGE BangPatterns #-} module HTrace where import Data.List (foldl') import Data.IORef import System.IO.Unsafe level = unsafePerformIO $ newIORef 0 htrace str x = unsafePerformIO $

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Christopher Brown
Hi Jason, Thanks very much for you thoughtful response. I am intrigued about the Happy route: as I have never really used Happy before, am I right in thinking I could take the .gr grammar, feed it into Happy to generate a parser, or a template for a parser, and then go from there? Chris. On

Re: [Haskell-cafe] Monad-control rant

2012-01-24 Thread Edward Z. Yang
Excerpts from Mikhail Vorozhtsov's message of Tue Jan 24 07:26:35 -0500 2012: > > Sure, but note that evaluate for IO is implemented with seq# under the hood, > > so as long as you actually get ordering in your monad it's fairly > > straightforward > > to implement evaluate. (Remember that the ab

Re: [Haskell-cafe] STM: "nested atomically" error

2012-01-24 Thread Johan Brinch
On Fri, Jan 13, 2012 at 00:14, Johan Brinch wrote: > Also, if the GHC IO system is using STM internally, what would be the > correct way to say write a file? (where the IO action can be retried > safely but have to run at least once, idempotent?). Please don't say > "don't" :-) I now believe that

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Jason Dagit
On Tue, Jan 24, 2012 at 6:54 AM, Christopher Brown wrote: > Hi Everyone, > > Thanks for everyone's kind responses: very helpful so far! > > I fully appreciate and understand how difficult writing a C++ parser is. > However I may need one for our new Paraphrase project, where I may be > targeting

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Christopher Brown
Hi Everyone, Thanks for everyone's kind responses: very helpful so far! I fully appreciate and understand how difficult writing a C++ parser is. However I may need one for our new Paraphrase project, where I may be targeting C++ for writing a refactoring tool. Obviously I don't want to start wr

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Jason Dagit
On Tue, Jan 24, 2012 at 2:06 AM, Christopher Brown wrote: > Hi, > > I have stumbled across language-c on hackage and I was wondering if anyone is > aware if there exists a full C++ parser written in Haskell? I don't think one exists. I've heard it's quite difficult to get template parsing worki

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Hans Aberg
On 24 Jan 2012, at 11:06, Christopher Brown wrote: > I have stumbled across language-c on hackage and I was wondering if anyone is > aware if there exists a full C++ parser written in Haskell? There is a yaccable grammar http://www.parashift.com/c++-faq-lite/compiler-dependencies.html#faq-38.

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Antoine Latter
On Tue, Jan 24, 2012 at 4:06 AM, Christopher Brown wrote: > Hi, > > I have stumbled across language-c on hackage and I was wondering if anyone is > aware if there exists a full C++ parser written in Haskell? > I'm not aware of one. When it comes to parsing C++, I've always been a fan of this es

Re: [Haskell-cafe] bindings for libvirt

2012-01-24 Thread Ilya Portnov
24.01.2012 10:50, Michael Litchard writes: Ilya, Yes please. Examining your code would go a long way toward helping me with this project. Ok, I published my current code at gitorious: https://gitorious.org/libvirt-hs. Please feel free to contribute, or even use (it's quite uncomplete c

Re: [Haskell-cafe] Data & newtype differences. Today: strictness

2012-01-24 Thread Erik Hesselink
An interesting use case for this is that while data Void = Void Void has infinitely many values (undefined, Void undefined, Void (Void undefined) etc), the newtype version newtype Void = Void Void has only one, bottom. This is a way to define the empty datatype without extensions. Erik On

Re: [Haskell-cafe] Monad-control rant

2012-01-24 Thread Mikhail Vorozhtsov
On 01/22/2012 02:47 AM, Edward Z. Yang wrote: Excerpts from Mikhail Vorozhtsov's message of Sat Jan 21 09:25:07 -0500 2012: But I also believe that you can't use this as justification to stick your head in the sand, and pretend bottoms don't exist (regardless of whether or not we'rd talking abou

Re: [Haskell-cafe] interest in Irish Haskell User's Group?

2012-01-24 Thread Andrew Butterfield
Count me in ! (i've also CCed a colleague) On 24 Jan 2012, at 11:27, John Lato wrote: > Hello, > > Some other Haskellers and I have been discussing starting an Irish > Haskell User's Group. I think we're close to critical mass, and need > just a few more interested people to give it a run. To

[Haskell-cafe] interest in Irish Haskell User's Group?

2012-01-24 Thread John Lato
Hello, Some other Haskellers and I have been discussing starting an Irish Haskell User's Group. I think we're close to critical mass, and need just a few more interested people to give it a run. To that end, I'd appreciate hearing from anyone who would be interested in attending or participating

[Haskell-cafe] Happy holidays Haskell

2012-01-24 Thread R J
hello Haskell ever since I started this my life has been better than ever http://www.news13open.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Haskellers in Delhi, India

2012-01-24 Thread Anupam Jain
On Tue, Jan 24, 2012 at 3:40 PM, Sean Leather wrote: > On Tue, Jan 24, 2012 at 10:21, Anupam Jain wrote: >> >> Are there any haskellers in Delhi or nearby areas interested in a >> meetup? I've been dabbling in Haskell for a long time > > > I'm not in India, but I am curious about the use of Haskel

Re: [Haskell-cafe] ghc-api Static Semantics?

2012-01-24 Thread Christopher Brown
>> > > Have you looked at ghc-syb-utils, which gives a neat way to print an AST? > > http://hackage.haskell.org/packages/archive/ghc-syb-utils/0.2.1.0/doc/html/GHC-SYB-Utils.html > Yes I found that yesterday! Chris. > -- > JP Moresmau > http://jpmoresmau.blogspot.com/ > > _

Re: [Haskell-cafe] ghc-api Static Semantics?

2012-01-24 Thread JP Moresmau
On Tue, Jan 24, 2012 at 11:04 AM, Christopher Brown wrote: > At the moment (and spending half a day yesterday just working out how to > 'show' an AST from the ghc-api) I'm veering towards haskell-src-exts. I > think extending it to contain use and bind locations in the AST would be the > best opt

Re: [Haskell-cafe] Why were unfailable patterns removed and "fail" added to Monad?

2012-01-24 Thread Michael Snoyman
On Fri, Jan 20, 2012 at 6:52 AM, Michael Snoyman wrote: > On Fri, Jan 20, 2012 at 6:41 AM, Edward Z. Yang wrote: >> Aw, that is really suboptimal.  Have you filed a bug? > > I think it's a feature, not a bug. When dealing with monads that > provide nice[1] implementations of `fail`, you can (ab)u

Re: [Haskell-cafe] Data & newtype differences. Today: strictness

2012-01-24 Thread Ketil Malde
Yves Parès writes: > I had for long thought that data and newtype were equivalent, but then I > spotted some differences when it comes to strictness. > > data Test = Test Int > newtype TestN = TestN Int Interesting. I'd thought that data Test = Test !Int and newtype Test = Test Int wou

Re: [Haskell-cafe] Haskellers in Delhi, India

2012-01-24 Thread Sean Leather
On Tue, Jan 24, 2012 at 10:21, Anupam Jain wrote: > Are there any haskellers in Delhi or nearby areas interested in a > meetup? I've been dabbling in Haskell for a long time I'm not in India, but I am curious about the use of Haskell or other FP languages for teaching/research there. Do you (or

[Haskell-cafe] C++ Parser?

2012-01-24 Thread Christopher Brown
Hi, I have stumbled across language-c on hackage and I was wondering if anyone is aware if there exists a full C++ parser written in Haskell? Many thanks, Chris. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/

Re: [Haskell-cafe] ghc-api Static Semantics?

2012-01-24 Thread Christopher Brown
Hi Ozgur, Yes I've looked at haskell-src-exts and it does look *much* easier to use. I need this to build a new refactoring tool for Haskell (for the Paraphrase project). One advantage to using the ghc-api directly is that's it's always cutting edge and maintained by the ghc team. Having one mo

Re: [Haskell-cafe] Efficient temporary file storage??

2012-01-24 Thread Gregory Crosswhite
On 1/24/12 5:51 PM, Vincent Hanquez wrote: On 01/24/2012 07:33 AM, Gregory Crosswhite wrote: On 1/24/12 9:43 AM, Felipe Almeida Lessa wrote: Use cereal [1], usually it's fast and easy enough. Out of curiosity, is binary no longer the recommended standard for such things? binary got only an

[Haskell-cafe] Haskellers in Delhi, India

2012-01-24 Thread Anupam Jain
Hi all, Are there any haskellers in Delhi or nearby areas interested in a meetup? I've been dabbling in Haskell for a long time but only recently became interested in creating large "real world" programs with it. It would be interesting to meet folks who already have such experience (or are lookin

[Haskell-cafe] ANNOUNCE: hxournal-0.6.3

2012-01-24 Thread Ian-Woo Kim
Hi, I am very happy to announce hxournal-0.6.3. (To learn about hxournal, see http://ianwookim.org/hxournal ) Compared with the previous version (0.6.2), it has now a big enhancement in rendering, implementing resizing selected elements and highlighter pen implementation. Now, after selection, you

[Haskell-cafe] Munich Haskell Meeting

2012-01-24 Thread Heinrich Hördegen
Dear all, I hope, all of you had a good start into this year. For Munich's Haskellers, it's time for our next get-together. With a number of participants between 12 and 14, our last meetings have been a real success. Let's continue this joyful events. Even if you don't live at Munich, if you