Re: [Haskell] Compilation of big, static tables

2006-02-23 Thread John Meacham
On Thu, Feb 23, 2006 at 10:40:31AM +, Malcolm Wallace wrote: > What I would really like is a syntax to statically construct an array, > without having to compute it from a list. I'm not sure that even > Template Haskell can help here, since there is no normal form for it to > translate to. Th

[Haskell] CFP: Mathematically Structured Functional Programming

2006-02-23 Thread Conor McBride
CALL FOR PAPERS Workshop on Mathematically Structured Functional Programming MSFP 2006 Kuressaare, Estonia, 2 July 2006 http://cs.ioc.ee/mpc-amast06/msfp/

Re: [Haskell] Re: Compilation of big, static tables

2006-02-23 Thread Malcolm Wallace
Atila Romero <[EMAIL PROTECTED]> wrote: > >Perhaps I should propose a new syntactic construct for the language? > > And how about create a 'reduction rules' syntax? It maps a common > construct that usually becomes slow code in predefined fast code. So > the optimization done by compiler becomes m

Re: [Haskell] Re: Compilation of big, static tables

2006-02-23 Thread Atila Romero
Malcolm Wallace wrote: >Hmm, that only works if the data being stored in the table is of regular >size? I need variable-length values. Using a two- or three-level >encoding into strings would start to get /really/ unpleasant. > >And this is pretty ghc-specific stuff. > >Perhaps I should propose

Re: [Haskell] Re: Compilation of big, static tables

2006-02-23 Thread Malcolm Wallace
> >> What I would really like is a syntax to statically construct an > >> array, without having to compute it from a list. I'm not sure that > >> even Template Haskell can help here, since there is no normal form > >> for it to translate to. > > SM> Happy & Alex use the hack of encoding static ar

Re: [Haskell] Re: Compilation of big, static tables

2006-02-23 Thread Bulat Ziganshin
Hello Simon, Thursday, February 23, 2006, 3:35:51 PM, you wrote: >> What I would really like is a syntax to statically construct an array, >> without having to compute it from a list. I'm not sure that even >> Template Haskell can help here, since there is no normal form for it to >> translate t

[Haskell] Re: Compilation of big, static tables

2006-02-23 Thread Simon Marlow
Malcolm Wallace wrote: Stefan Karrmann <[EMAIL PROTECTED]> wrote: can ghc compile huge tables into efficient code if they are constant at compile time? I have a related but different question. If I have large, statically defined tables of data e.g. table = listArray (0,max) [ [1,2,3,4

[Haskell] Re: Compilation of big, computed tables

2006-02-23 Thread Simon Marlow
Bjorn Lisper wrote: Chris Kuklewicz: Stefan Karrmann wrote: Dear all, can ghc compile huge tables into efficient code if they are constant at compile time? Two examples may clearify the question: big1 :: UArray Int Char big1 = array (0,1000) $! map (\i -> (i,toEnum i)) [0..1000] big2 = su

RE: [Haskell] Compilation of big, computed tables

2006-02-23 Thread Simon Peyton-Jones
http://haskell.org/haskellwiki/GHC:FAQ (search for cse) | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bjorn Lisper | Sent: 23 February 2006 10:28 | To: [EMAIL PROTECTED] | Cc: Haskell@haskell.org | Subject: Re: [Haskell] Compilation of big, computed

[Haskell] Compilation of big, static tables

2006-02-23 Thread Malcolm Wallace
Stefan Karrmann <[EMAIL PROTECTED]> wrote: > can ghc compile huge tables into efficient code if they are constant > at compile time? I have a related but different question. If I have large, statically defined tables of data e.g. table = listArray (0,max) [ [1,2,3,4]

Re: [Haskell] Compilation of big, computed tables

2006-02-23 Thread Bjorn Lisper
Chris Kuklewicz: >Stefan Karrmann wrote: >> Dear all, >> >> can ghc compile huge tables into efficient code if they are constant at >> compile time? >> >> Two examples may clearify the question: >> >> big1 :: UArray Int Char >> big1 = array (0,1000) $! map (\i -> (i,toEnum i)) [0..1000] >> >>