Re: [Haskell-cafe] Template Haskell a Permanent solution?

2011-01-18 Thread Ian Lynagh
On Tue, Jan 04, 2011 at 04:15:07PM +0100, Christian Maeder wrote: Am 04.01.2011 15:48, schrieb Henning Thielemann: Christian Maeder schrieb: Am 27.12.2010 08:44, schrieb Henning Thielemann: On Mon, 27 Dec 2010, Jonathan Geddes wrote: #2 Provide instances automatically.

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2011-01-04 Thread Christian Maeder
Am 27.12.2010 08:44, schrieb Henning Thielemann: On Mon, 27 Dec 2010, Jonathan Geddes wrote: #1 Parse a string at compile-time so that a custom syntax for representing data can be used. At the extreme, this data might even be an EDSL. I think it would be enough, if the compiler could be

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2011-01-04 Thread Dominique Devriese
All, 2010/12/27 Jonathan Geddes geddes.jonat...@gmail.com: I see TH used most for the following tasks: #1 Parse a string at compile-time so that a custom syntax for representing data can be used. At the extreme, this data might even be an EDSL. #2 Provide instances automatically. Just a

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2011-01-04 Thread Henning Thielemann
Christian Maeder schrieb: Am 27.12.2010 08:44, schrieb Henning Thielemann: On Mon, 27 Dec 2010, Jonathan Geddes wrote: #2 Provide instances automatically. http://www.haskell.org/ghc/docs/7.0-latest/html/users_guide/generic-classes.html I see the text below and have no idea where the

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2011-01-04 Thread Christian Maeder
Am 04.01.2011 15:48, schrieb Henning Thielemann: Christian Maeder schrieb: Am 27.12.2010 08:44, schrieb Henning Thielemann: On Mon, 27 Dec 2010, Jonathan Geddes wrote: #2 Provide instances automatically. http://www.haskell.org/ghc/docs/7.0-latest/html/users_guide/generic-classes.html I see

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-28 Thread Tillmann Rendel
Hi, Jonathan Geddes wrote: For TH use #1, compile-time parsing of arbitrary strings, I think it would be nice for quasiquote semantics to be modified so that code like json :: String - JsonObject json = ... data = [ json | { name : Jonathan , favorite language: Haskell } |]

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-28 Thread Jonathan Geddes
On Tue, Dec 28, 2010 at 8:17 AM, Tillmann Rendel ren...@mathematik.uni-marburg.de wrote: This seems simple enough to me, so it looks as if your use case is already supported as a library on top of the more general API. This is exactly what I was looking for, and much simpler than my previous

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-27 Thread Stephen Tetley
On 27 December 2010 07:35, Jonathan Geddes geddes.jonat...@gmail.com wrote: #1 Parse a string at compile-time so that a custom syntax for representing data can be used. At the extreme, this data might even be an EDSL. Hello Jonathan By this are you meaning to add quasiquoting to the

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-27 Thread Jonas Almström Duregård
Hi, But TH gives me the same feeling as other language features that have been described as bolted on. Also, TH is both library and built-in syntax (via an extension) which feels strange to me. I don't understand why the library/extension duality is a problem. I would say that the best

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-27 Thread Jonas Almström Duregård
Hi Henning, I also think that Template Haskell is used too much. Several things that are done in existing libraries could be done in plain Haskell in a better way. Can you give any examples of this? I'm not saying it's not true, I'm just curious as to why you would venture into the realm of

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-27 Thread Henning Thielemann
On Mon, 27 Dec 2010, Jonas Almström Duregård wrote: Hi Henning, I also think that Template Haskell is used too much. Several things that are done in existing libraries could be done in plain Haskell in a better way. Can you give any examples of this? I'm not saying it's not true, I'm just

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-27 Thread Ivan Lazar Miljenovic
2010/12/27 Henning Thielemann lemm...@henning-thielemann.de: Or look into package 'encoding'. It uses TemplateHaskell in order to convert Text descriptions of character sets into Haskell tables. I think the character tables could be simply rewritten to Haskell syntax, or they could be parsed

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-27 Thread Jonathan Geddes
On Mon, Dec 27, 2010 at 12:44 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: I think it would be enough, if the compiler could be told to unfold an expression like  parse text in a domain specific language  at compile time. I'm afraid I have to disagree with you here. Being able

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-27 Thread Jonathan Geddes
On Mon, Dec 27, 2010 at 1:14 AM, Stephen Tetley stephen.tet...@gmail.com wrote: By this are you meaning to add quasiquoting to the language Haskell or the Glasgow Haskell, taking it out of the domain of Template Haskell? I believe that all new features should start as extensions and as an

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-27 Thread Jonathan Geddes
Thanks, everyone, for the responses. I don't understand why the library/extension duality is a problem. I don't think it is a _problem_ it just feels strange to me. Maybe I'm misunderstanding, is it possible to use TH without using the library components? Shouldn't specialized features be

[Haskell-cafe] Template Haskell a Permanent solution?

2010-12-26 Thread Jonathan Geddes
Cafe, First let me say that Template Haskell is very powerful and a lot of great work has been done in this area. It fills in a number of holes in Haskell's feature set. But TH gives me the same feeling as other language features that have been described as bolted on. Also, TH is both library

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2010-12-26 Thread Henning Thielemann
On Mon, 27 Dec 2010, Jonathan Geddes wrote: #1 Parse a string at compile-time so that a custom syntax for representing data can be used. At the extreme, this data might even be an EDSL. I think it would be enough, if the compiler could be told to unfold an expression like parse text in a