Re: [Haskell-cafe] Scraping boilerplate deriving?

2010-09-15 Thread Jonas Almström Duregård
#define defObj(t) newtype t = t Obj deriving (A,B,C,D) Blasphemy! :) On 14 September 2010 23:01, John Meacham j...@repetae.net wrote: On Tue, Sep 14, 2010 at 01:24:16AM -0700, Kevin Jardine wrote: I have a set of wrapper newtypes that are always of the same format: newtype MyType =

[Haskell-cafe] Stack traces in GHC

2010-09-15 Thread Mihai Maruseac
Hi, Just did a preview of bug #3693 [1] and saw that there are a few patches issued there. Does this mean that the problem is solved and there would be stack traces in a future version of GHC? I'll test the patches in 24 hours, when I'll be back at home. -- Mihai [1]:

Re: [Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Malcolm Wallace
That's what I had originally. However, some people have made critical comments about CPP macros on this list and I thought that TH was considered the better option. I was one of those people advising against the use of CPP macros. However, Template Haskell is ghc-only, and is unlikely ever

Re: [Haskell-cafe] Stack traces in GHC

2010-09-15 Thread Ivan Lazar Miljenovic
On 15 September 2010 18:10, Mihai Maruseac mihai.marus...@gmail.com wrote: Hi, Just did a preview of bug #3693 [1] and saw that there are a few patches issued there. Does this mean that the problem is solved and there would be stack traces in a future version of GHC? I'll test the patches

Re: [Haskell-cafe] Stack traces in GHC

2010-09-15 Thread Mihai Maruseac
Sorry, updated now :) http://hackage.haskell.org/trac/ghc/ticket/3693 On Wed, Sep 15, 2010 at 11:45 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 15 September 2010 18:10, Mihai Maruseac mihai.marus...@gmail.com wrote: Hi, Just did a preview of bug #3693 [1] and saw that there

[Haskell-cafe] try, seq, and IO

2010-09-15 Thread Jeroen van Maanen
The past year I have been working on a port of my machine learning project named LExAu from Java to Haskell. I'm still very glad I took the jump, because the complexity curve appears to be log shaped rather than exp shaped. In one year I almost got to the functionality that had taken me five

Re: [Haskell-cafe] benchmarking c/c++ and haskell

2010-09-15 Thread Daniel Fischer
On Wednesday 15 September 2010 02:50:15, David Terei wrote: On 13 September 2010 20:41, Vo Minh Thu not...@gmail.com wrote: ... the post is from 2008. No LLVM goodness. So I thought GHC 6.12.1 (not the latest and greatest HEAD) would be enough. I compiled the two programs myself out of

[Haskell-cafe] Set of Haskell programs

2010-09-15 Thread Enrique Martín
Hello, I would want to ask if there is any set of real Haskell 98 programs publicly available. I am working on a program transformation and I would want to test it with several real programs. I think it is a good idea to have a set of standard programs that people could use to check the

Re: [Haskell-cafe] Set of Haskell programs

2010-09-15 Thread Eugene Kirpichov
The nobench suite. 2010/9/15 Enrique Martín emart...@fdi.ucm.es:  Hello, I would want to ask if there is any set of real Haskell 98 programs publicly available. I am working on a program transformation and I would want to test it with several real programs. I think it is a good idea to have

Re: [Haskell-cafe] benchmarking c/c++ and haskell

2010-09-15 Thread Vo Minh Thu
Thanks all for your answsers. I still wonder why some people get very different results between gcc and ghc, and some others don't. A difference in processor? I guess I will crank up a little package using criterion and producing two executables to make sure anyone who run the benchmark use the

Re: [Haskell-cafe] Set of Haskell programs

2010-09-15 Thread Ivan Lazar Miljenovic
2010/9/15 Enrique Martín emart...@fdi.ucm.es:  Hello, I would want to ask if there is any set of real Haskell 98 programs publicly available. I am working on a program transformation and I would want to test it with several real programs. I think it is a good idea to have a set of standard

Re: [Haskell-cafe] benchmarking c/c++ and haskell

2010-09-15 Thread Daniel Fischer
On Wednesday 15 September 2010 12:22:24, Vo Minh Thu wrote: Thanks all for your answsers. I still wonder why some people get very different results between gcc and ghc, and some others don't. A difference in processor? Architecture (32/64-bit, x86/..., ...), processor, gcc version, OS, all

[Haskell-cafe] haskell.org committee: Call for nominations

2010-09-15 Thread Ian Lynagh
Dear Haskellers, The recent discussion indicates there is consensus for forming a haskell.org committee. We are therefore calling for nominations for members of the initial committee. To nominate yourself, please send an e-mail to commit...@haskell.org by 29 September 2010. Please feel free to

Re: [Haskell-cafe] Set of Haskell programs

2010-09-15 Thread Chris BROWN
Hi Ivan, HaRe itself is not Haskell 98, but for testing purposes we have used various Haskell 98 programs and test suites. One rather large full Haskell 98 program that we have used to test HaRe is nhc: http://www.cs.york.ac.uk/fp/nhc98/ nhc also comes with various Haskell 98 test suites, all

[Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Kevin Jardine
Hi Malcolm, In this case, I am counting on GHC's {-# LANGUAGE GeneralizedNewtypeDeriving #-} feature to derive the instances for the classes I am including in the deriving clause. So perhaps portability is not a big issue here in any case. I do think that defObj(MyType) looks a bit cleaner

Re: [Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Ben Millwood
On Wed, Sep 15, 2010 at 2:11 PM, Kevin Jardine kevinjard...@gmail.com wrote: I do think that defObj(MyType) looks a bit cleaner than $(defObj MyType) I believe as of GHC 6.12 you no longer need the $() around top-level splices. So that would just be: defObj MyType

[Haskell-cafe] Generating arbitrary functions with QuickCheck?

2010-09-15 Thread Matias Eyzaguirre
Hi, I'v been reading a small paper/lesson on writing parser combinators in Haskell, and it seems more or less straightforward. In this case a parser is defined thusly: type Parser a = String - Maybe (a, String) And then it goes on to list some simple parsers, and then starts going on about

[Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Kevin Jardine
Hi Ben, Good point! I can confirm that it does compile under GHC 6.12. So really the same number of characters either way. Kevin On Sep 15, 4:49 pm, Ben Millwood hask...@benmachine.co.uk wrote: On Wed, Sep 15, 2010 at 2:11 PM, Kevin Jardine kevinjard...@gmail.com wrote: I do think that

Re: [Haskell-cafe] Generating arbitrary functions with QuickCheck?

2010-09-15 Thread Thomas Davie
On 15 Sep 2010, at 16:29, Matias Eyzaguirre wrote: Hi, I'v been reading a small paper/lesson on writing parser combinators in Haskell, and it seems more or less straightforward. In this case a parser is defined thusly: type Parser a = String - Maybe (a, String) And then it goes on to

Re: [Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Gregory Crosswhite
On 9/15/10 1:31 AM, Malcolm Wallace wrote: [...] However, Template Haskell is ghc-only, and is unlikely ever to be implemented by any other Haskell compiler. [...] Could it be implemented as a separate preprocessor? Cheers, Greg ___ Haskell-Cafe

Re: [Haskell-cafe] try, seq, and IO

2010-09-15 Thread Gregory Crosswhite
Check out the evaluate function in Control.Exception. Also note that if you apply seq to an IO action, you do *not* force the result, only the action that will eventually produce the result. Cheers, Greg On 9/15/10 2:13 AM, Jeroen van Maanen wrote: The past year I have been working on a

Re: [Haskell-cafe] A new cabal odissey: cabal-1.8 breaking its own neck by updating its dependencies

2010-09-15 Thread Duncan Coutts
On 13 September 2010 20:54, Paolo Giarrusso p.giarru...@gmail.com wrote: On Sun, Sep 12, 2010 at 20:46, Tillmann Rendel ren...@mathematik.uni-marburg.de wrote: Paolo Giarrusso wrote: in a tracker entry you linked to, http://hackage.haskell.org/trac/hackage/ticket/704, duncan argues that we

Re: [Haskell-cafe] try, seq, and IO

2010-09-15 Thread Neil Brown
On 15/09/10 10:13, Jeroen van Maanen wrote: The past year I have been working on a port of my machine learning project named LExAu from Java to Haskell. I'm still very glad I took the jump, because the complexity curve appears to be log shaped rather than exp shaped. In one year I almost got

RE: [Haskell-cafe] try, seq, and IO

2010-09-15 Thread Simon Peyton-Jones
You may get useful help from Haskell Cafe. But if you can produce a cut-down example without complex dependencies, we could also look at it. Simon | -Original Message- | From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe- | boun...@haskell.org] On Behalf Of Jeroen van Maanen |

Re: [Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Antoine Latter
It has been - there is a package called 'zeroth' on hackage. It only works for top-level splices, the last I looked. On Sep 15, 2010 11:20 AM, Gregory Crosswhite gcr...@phys.washington.edu wrote: On 9/15/10 1:31 AM, Malcolm Wallace wrote: [...] However, Template Haskell is ghc-only, and is

[Haskell-cafe] Memoization/call-by-need

2010-09-15 Thread Alex Rozenshteyn
I feel that there is something that I don't understand completely: I have been told that Haskell does not memoize function call, e.g. slowFib 50 will run just as slowly each time it is called. However, I have read that Haskell has call-by-need semantics, which were described as lazy evaluation

Re: [Haskell-cafe] A new cabal odissey: cabal-1.8 breaking its own neck by updating its dependencies

2010-09-15 Thread Paolo Giarrusso
Hi Duncan, first, thanks for coming yourself to answer. On Wed, Sep 15, 2010 at 18:33, Duncan Coutts duncan.cou...@googlemail.com wrote: On 13 September 2010 20:54, Paolo Giarrusso p.giarru...@gmail.com wrote: On Sun, Sep 12, 2010 at 20:46, Tillmann Rendel ren...@mathematik.uni-marburg.de

Re: [Haskell-cafe] Generating arbitrary functions with QuickCheck?

2010-09-15 Thread Stephen Tetley
On 15 September 2010 16:29, Matias Eyzaguirre dente...@gmail.com wrote: Secondly, (and more importantly, or at least more interesting) I can see how one would make a generator for simple compound data types, but how on earth do you make a generator produce

Re: [Haskell-cafe] Memoization/call-by-need

2010-09-15 Thread Tim Chevalier
On 9/15/10, Alex Rozenshteyn rpglove...@gmail.com wrote: I feel that there is something that I don't understand completely: I have been told that Haskell does not memoize function call, e.g. slowFib 50 will run just as slowly each time it is called. However, I have read that Haskell has

Re: [Haskell-cafe] Simple Parsec example, question

2010-09-15 Thread Peter Schmitz
Antoine, Thank you very much for your reply. Adding type sigs did help me think about it. I got it to work. I replaced: eol = char '\n' textLines = endBy eol with: textLine :: Parser String textLine = do x - many (noneOf \n) char '\n' return x textLines :: Parser [String]

[Haskell-cafe] Re: IO Put confusion

2010-09-15 Thread Chad Scherrer
Chad Scherrer chad.scherrer at gmail.com writes: Second attempt: doc :: IO Put doc = docLength = go where go 1 = word go n = do w - word ws - go (n-1) return (w putSpace ws) This one actually works, but it holds onto everything in memory instead of outputting as

Re: [Haskell-cafe] Memoization/call-by-need

2010-09-15 Thread Daniel Fischer
On Wednesday 15 September 2010 22:38:48, Tim Chevalier wrote: On the other hand, if you wrote: let fib50 = slowFib 50 in   fib50 + (slowFib 50) then (slowFib 50) would be evaluated twice, because there's no principle requiring the compiler to notice that (slowFib 50) is the same expression

Re: [Haskell-cafe] Simple Parsec example, question

2010-09-15 Thread Daniel Fischer
On Wednesday 15 September 2010 23:01:34, Peter Schmitz wrote: textLine :: Parser String textLine = do    x - many (noneOf \n)    char '\n'    return x textLines :: Parser [String] textLines = many textLine And it can probably be coded more succinctly that that (suggestions

Re: [Haskell-cafe] Simple Parsec example, question

2010-09-15 Thread Peter Schmitz
Daniel, Thanks much; the more I learn Haskell and Parsec, the more I like them. -- Peter On Wed, Sep 15, 2010 at 4:02 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: On Wednesday 15 September 2010 23:01:34, Peter Schmitz wrote: textLine :: Parser String textLine = do    x - many

[Haskell-cafe] [PREANNOUNCE] Crypto-API Major Version Bump (0.1.0.0)

2010-09-15 Thread Thomas DuBuisson
All, Ironing out crypto-api, I have commited the below changes mostly intended to streamline crypto-api and focus it on the main purpose of connecting algorithm developers with slightly higher-level (and generic) function needed by crypto-users. Feel free to object, comment, or recommend

Re: [Haskell-cafe] Generating arbitrary functions with QuickCheck?

2010-09-15 Thread Ivan Lazar Miljenovic
On 16 September 2010 01:58, Thomas Davie tom.da...@gmail.com wrote: Firstly, as far as i can tell, one cannot declare a type synonym to be an instance of a type class, thus how would you make it an instance of Arbitrary? The standard solution here is to create a newtype, and generate them

Re: [Haskell-cafe] [PREANNOUNCE] Crypto-API Major Version Bump (0.1.0.0)

2010-09-15 Thread Felipe Lessa
On Wed, Sep 15, 2010 at 9:54 PM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: * cereal = 0.2 0.3 (was == 0.2.*) Do you mean, = 0.2 0.4? Cheers! =) -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] [PREANNOUNCE] Crypto-API Major Version Bump (0.1.0.0)

2010-09-15 Thread Thomas DuBuisson
On Wed, Sep 15, 2010 at 6:38 PM, Felipe Lessa felipe.le...@gmail.com wrote: On Wed, Sep 15, 2010 at 9:54 PM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: * cereal = 0.2 0.3 (was == 0.2.*) Do you mean, = 0.2 0.4? Yes, that was what I ment, thanks!

Re: [Haskell-cafe] Memoization/call-by-need

2010-09-15 Thread Conal Elliott
Hi Alex, In Haskell, data structures cache, while functions do not. Memoization is conversion of functions into data structures (and then trivially re-wrapping as functions) so as to exploit the caching property of data structures to get caching functions. - Conal On Wed, Sep 15, 2010 at

[Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Peter Schmitz
Not that I'm having any problem with parsec 2.1.0.1, but I guess I would like to install the latest (3.1.0), unless there is a reason not to. I can't seem to get Cabal to do so; thanks in advance for any help. I don't understand part of the output from cabal install --dry-run --reinstall -v

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Thomas DuBuisson
Parsec 3 is unloved by much of the community because it's evidently slower than parsec 2. For this reason the community remains divided over the two versions and cabal has special preferred versions of particular packages. To force installation of parsec 3, over the preferred parsec 2, you

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Ivan Lazar Miljenovic
On 16 September 2010 12:47, Peter Schmitz ps.hask...@gmail.com wrote: Not that I'm having any problem with parsec 2.1.0.1, but I guess I would like to install the latest (3.1.0), unless there is a reason not to. Because Parsec-3 apparently still has some speed regressions compared to Parsec-2

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Peter Schmitz
Thomas, Ivan, Thanks much for the info. -- Peter On Wed, Sep 15, 2010 at 8:00 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 16 September 2010 12:47, Peter Schmitz ps.hask...@gmail.com wrote: Not that I'm having any problem with parsec 2.1.0.1, but I guess I would like to

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Jason Dagit
On Wed, Sep 15, 2010 at 7:47 PM, Peter Schmitz ps.hask...@gmail.com wrote: Not that I'm having any problem with parsec 2.1.0.1, but I guess I would like to install the latest (3.1.0), unless there is a reason not to. I can't seem to get Cabal to do so; thanks in advance for any help. I

Re: [Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread wren ng thornton
On 9/15/10 9:11 AM, Kevin Jardine wrote: Hi Malcolm, In this case, I am counting on GHC's {-# LANGUAGE GeneralizedNewtypeDeriving #-} feature to derive the instances for the classes I am including in the deriving clause. So perhaps portability is not a big issue here in any case. Yes, but

Re: [Haskell-cafe] types for parsing a tree

2010-09-15 Thread Jared Jennings
On Fri, Sep 10, 2010 at 2:00 PM, S. Doaitse Swierstra doai...@swierstra.net wrote: I show how this can be done using uu-parsinglib. Note that we have sevral parsers, each having its own type: Thanks for such a complete example, Doaitse! Unfortunately I have a requirement I didn't disclose: the

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Peter Schmitz
Jason, Thank you for the insights into Cabal. I am new to Parsec, and relatively new to Cabal, and was not aware of the info that you (and Thomas and Ivan) posted. Great help; thanks again. I will probably stick with Cabal's default for the time being because I don't have a compelling reason not

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Ivan Lazar Miljenovic
On 16 September 2010 13:52, Peter Schmitz ps.hask...@gmail.com wrote: I will probably stick with Cabal's default for the time being because I don't have a compelling reason not to, but it's good to know how Cabal works. Well, despite having a compatability API, Parsec-3 also has a completely

Re: [Haskell-cafe] Memoization/call-by-need

2010-09-15 Thread wren ng thornton
On 9/15/10 10:39 PM, Conal Elliott wrote: Hi Alex, In Haskell, data structures cache, while functions do not. Exactly. What this means is that when you call (slowFib 50) Haskell does not alter slowFib in any way to track that it maps 50 to $whatever; however, it does track that that

Re: [Haskell-cafe] Re: Do expression definition

2010-09-15 Thread wren ng thornton
On 9/13/10 6:22 AM, Michael Lazarev wrote: Thanks for examples and pointers. Since I came from Lisp, it never occurred to me that let and lambda are different constructs in Haskell. I thought that let x = y in f is really (\x - f) y It turns out that let is about declarations which

Re: [Haskell-cafe] Re: Full strict functor by abusing Haskell exceptions

2010-09-15 Thread wren ng thornton
On 9/13/10 6:23 PM, Paolo G. Giarrusso wrote: Then, I would also like to understand what exactly a strict functor is, in detail, and/or a link to the post you reference. I'm assuming the OP was referring to a functor for strictness I mentioned recently in the discussion about pointed

Re: [Haskell-cafe] types for parsing a tree

2010-09-15 Thread Malcolm Wallace
I have a requirement I didn't disclose: the simple tags like TRNUID, NAME, AMOUNT could come in any order; and some are optional. Search for permutation parsing; Doaitse has thought of that too! Regards, Malcolm ___ Haskell-Cafe mailing list