Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-04 Thread Joerg Fritsch
Kim-Eeh, Tillmann, I am interested in the definition of deep vs shallow embedded, even if it is not featured in the Fowler textbook. Fowler that is one textbook "only" and I am not focused on it. --Joerg On Dec 5, 2012, at 2:59 AM, Kim-Ee Yeoh wrote: > On Wed, Dec 5, 2012 at 8:32 AM, Tillma

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Jason Dagit
On Tue, Dec 4, 2012 at 9:37 PM, Johan Tibell wrote: > Hi Oleg, > > On Tue, Dec 4, 2012 at 9:13 PM, wrote: > > I am doing, for several months, constant-space processing of large XML > > files using iteratees. The file contains many XML elements (which are > > a bit complex than a number). An ele

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Johan Tibell
Hi Oleg, On Tue, Dec 4, 2012 at 9:13 PM, wrote: > I am doing, for several months, constant-space processing of large XML > files using iteratees. The file contains many XML elements (which are > a bit complex than a number). An element can be processed > independently. After the parser finished

[Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread oleg
I am doing, for several months, constant-space processing of large XML files using iteratees. The file contains many XML elements (which are a bit complex than a number). An element can be processed independently. After the parser finished with one element, and dumped the related data, the process

[Haskell-cafe] Understanding GHC's instance inference.

2012-12-04 Thread Takayuki Muranushi
Dear everyone, I have a code https://github.com/nushio3/practice/blob/master/instance-inference/zipf-11-1.hs that produces a type-error when I remove a type signature. https://github.com/nushio3/practice/blob/master/instance-inference/zipf-11.hs The strange point is the following error message f

Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-04 Thread Kim-Ee Yeoh
On Wed, Dec 5, 2012 at 8:32 AM, Tillmann Rendel < ren...@informatik.uni-marburg.de> wrote: > I mean internal == embedded, independently of deep vs. shallow, following > Martin Fowler [1]. > [1] > http://martinfowler.com/bliki/**DomainSpecificLanguage.html

[Haskell-cafe] confirming order of kinds and rank of types

2012-12-04 Thread dude
I hope you can help me confirm my understanding of the order of kinds and rank of types as reported in [1,2]. I have been validating the mapping functions in Section 2 against the GHC 7.4.2 type checker by explicitly annotating the universal quantifiers as described in [1]. 1. Just to baseline

Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-04 Thread Kim-Ee Yeoh
Little things to check understanding: * ghc/ghci implements a DSL called Haskell -- does it do so in a deep or shallow way? * where are the shallow DSLs? the deep ones? (hint: some of them are right under our very noses!) -- Kim-Ee On Wed, Dec 5, 2012 at 12:49 AM, Stephen Tetley wrote: > In H

Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-04 Thread Tillmann Rendel
Hi, Joerg Fritsch wrote: is a shallow embedded DSL == an internal DSL and a deeply embedded DSL == an external DSL or the other way around? I mean internal == embedded, independently of deep vs. shallow, following Martin Fowler [1]. Tillmann [1] http://martinfowler.com/bliki/DomainSpeci

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-04 Thread Clark Gaebel
Thanks! I'll read through "Matricies and Linear Algebra" over the next few days. - Clark On Tue, Dec 4, 2012 at 7:43 PM, Alexander Solla wrote: > Sorry, I didn't realize that course was offered next year. I read through > "Matrices and Linear Algebra" when I was in high school. And used > F

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-04 Thread Trevor L. McDonell
Thanks for the insight Alex. In case you are concerned, Accelerate is not in fact a linear algebra library. On 05/12/2012, at 11:43 AM, Alexander Solla wrote: > Sorry, I didn't realize that course was offered next year. I read through > "Matrices and Linear Algebra" when I was in high school.

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-04 Thread Alexander Solla
Sorry, I didn't realize that course was offered next year. I read through "Matrices and Linear Algebra" when I was in high school. And used Friedberg, Insel, Spence's "Linear Algebra" in college. On Tue, Dec 4, 2012 at 4:37 PM, Alexander Solla wrote: > Well, an m x n matrix corresponds to a li

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-04 Thread Alexander Solla
Well, an m x n matrix corresponds to a linear transformation in at most min{m,n} dimensions. In particular, this means that a 2x2 matrix corresponds to a plane, line, or the origin of 3-space, as a linear subspace. Which of those the matrix corresponds to depends on the matrix's "rank", which is

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-04 Thread Clark Gaebel
No. But that doesn't stop me from being curious with Accelerate. Might you have a better explaination for what's happening here than Trevor's? - Clark On Tue, Dec 4, 2012 at 7:08 PM, Alexander Solla wrote: > I don't mean to be blunt, but have you guys taken a course in linear > algebra? > > >

Re: [Haskell-cafe] Naive matrix multiplication with Accelerate

2012-12-04 Thread Alexander Solla
I don't mean to be blunt, but have you guys taken a course in linear algebra? On Mon, Dec 3, 2012 at 9:21 PM, Trevor L. McDonell < tmcdon...@cse.unsw.edu.au> wrote: > As far as I am aware, the only description is in the Repa paper. I you are > right, it really should be explained properly somewh

Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-04 Thread Stephen Tetley
In Haskell, shallow DSLs generate values - deep DSLs generate structures (typically abstract syntax trees), the structure can subsequently be used to generate a value (or a C program, or a HTML page, etc.). See Andy Gill and colleagues "Types and Type Families for Hardware Simulation and Synthesis

Re: [Haskell-cafe] Is hackage.haskell.org down?

2012-12-04 Thread Clark Gaebel
Works for me. On Tue, Dec 4, 2012 at 11:03 AM, Niklas Hambüchen wrote: > Down for me. > > On Tue 04 Dec 2012 15:44:10 GMT, Ivan Perez wrote: > > Hi haskellers, > > > > I've been having problems to access hackage.haskell.org for the past > > 2-4 hours. Is everything ok? > > > > Cheers, > > Ivan

Re: [Haskell-cafe] Is hackage.haskell.org down?

2012-12-04 Thread Niklas Hambüchen
Down for me. On Tue 04 Dec 2012 15:44:10 GMT, Ivan Perez wrote: > Hi haskellers, > > I've been having problems to access hackage.haskell.org for the past > 2-4 hours. Is everything ok? > > Cheers, > Ivan > > ___ > Haskell-Cafe mailing list > Haskell-Cafe

[Haskell-cafe] PLMW: Mentoring at POPL. Second Call for Participation

2012-12-04 Thread Gareth Smith
Students! You have until Sunday to apply for funding to come to both POPL and PLMW! CALL FOR PARTICIPATION SIGPLAN Programming Languages Mentoring Workshop, Rome Tuesday January 22, 2013 Co-located with POPL 2013 PLMW web page: http://www.doc.ic.ac.uk/~gds/PLMW/index.html After the resoundin

[Haskell-cafe] Is hackage.haskell.org down?

2012-12-04 Thread Ivan Perez
Hi haskellers, I've been having problems to access hackage.haskell.org for the past 2-4 hours. Is everything ok? Cheers, Ivan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Iustin Pop
On Tue, Dec 04, 2012 at 03:58:24PM +0100, Herbert Valerio Riedel wrote: > Iustin Pop writes: > > [...] > > > Let's say we have a simple JSON message: an array of 5 million numbers. > > I would like to parse this in constant space, such that if I only need > > the last element, overall memory usa

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Herbert Valerio Riedel
Clark Gaebel writes: [...] > I didn't even know people used JSON to store millions of integers. It > sounds like fun. Actually, JSON is quite convenient if you need a standardized common interchange format between Python, Ruby, JS et al. based components as it directly maps to a common subset o

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Herbert Valerio Riedel
Iustin Pop writes: [...] > Let's say we have a simple JSON message: an array of 5 million numbers. > I would like to parse this in constant space, such that if I only need > the last element, overall memory usage is low (yes, unrealistic use, but > please bear with me for a moment). > > Using ae

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Iustin Pop
On Tue, Dec 04, 2012 at 09:47:52AM -0500, Clark Gaebel wrote: > Aeson is used for the very common usecase of short messages that need to be > parsed as quickly as possible into a static structure. A lot of things are > sacrificed to make this work, such as incremental parsing and good error > messa

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Clark Gaebel
Aeson is used for the very common usecase of short messages that need to be parsed as quickly as possible into a static structure. A lot of things are sacrificed to make this work, such as incremental parsing and good error messages. It works great for web APIs like twitter's. I didn't even know p

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Iustin Pop
On Tue, Dec 04, 2012 at 12:23:19PM -0200, Felipe Almeida Lessa wrote: > Aeson doesn't have an incremental parser so it'll be > difficult/impossible to do what you want. I guess you want an > event-based JSON parser, such as yajl [1]. I've never used this > library, though. Ah, I see. Thanks, I w

Re: [Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Felipe Almeida Lessa
Aeson doesn't have an incremental parser so it'll be difficult/impossible to do what you want. I guess you want an event-based JSON parser, such as yajl [1]. I've never used this library, though. Cheers, [1] http://hackage.haskell.org/package/yajl-0.3.0.5 On Tue, Dec 4, 2012 at 12:11 PM, Iusti

[Haskell-cafe] Is it possible to have constant-space JSON decoding?

2012-12-04 Thread Iustin Pop
Hi, I'm trying to parse a rather simple but big JSON message, but it turns out that memory consumption is a problem, and I'm not sure what the actual cause is. Let's say we have a simple JSON message: an array of 5 million numbers. I would like to parse this in constant space, such that if I only

Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-04 Thread Kim-Ee Yeoh
On Tue, Dec 4, 2012 at 4:53 PM, Joerg Fritsch wrote: > is a shallow embedded DSL == an internal DSL and a deeply embedded DSL == an external DSL or the other way around? Roughly speaking, yes. But a deep DSL doesn't mean you've got to have a parser << tokenizer << IO input. You can get a deep DSL

Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-04 Thread Joerg Fritsch
Hi Tillmann, is a shallow embedded DSL == an internal DSL and a deeply embedded DSL == an external DSL or the other way around? --Joerg On Dec 3, 2012, at 11:40 PM, Tillmann Rendel wrote: > Hi, > > Joerg Fritsch wrote: >> I am working on a DSL that eventuyally would allow me to say: >> >> im