Re: (Failing to) look up names generated by Template Haskell

2018-01-25 Thread Ranjit Jhala
On further inspection, the problem is not with TH but with family instances. That is, suppose Library.hs is has the constructors defined in the simple top-level style: ``` data EntityField typ where BlobXVal :: EntityField Int BlobYVal :: EntityField Int ``` Then when analyzing Client.hs, th

(Failing to) look up names generated by Template Haskell

2018-01-25 Thread Ranjit Jhala
Hi all, I am stuck on the following problem. Suppose you have two module Lib Client where Client "imports" Lib. Now, while analyzing the Core of `Client` often I need to resolve the name of a `TyThing` defined inside `Lib`. Normally, this is easy enough: I simply use hscTcRcLookupNam

RFC: explicit support for GADTs in Template Haskell

2015-12-21 Thread Jan Stolarek
GHC Users, I am working on adding proper support for GADTs in Template Haskell. By proper I mean that GADTs data constructors will no longer be encoded using H98 data constructors, but will be represented explicity. GADTs allow to declare several constructors with the same signature: data

RE: Restricted Template Haskell

2015-02-03 Thread Simon Peyton Jones
ct: Re: Restricted Template Haskell I would like to figure out how to improve the state of TTH documentation. The GHC wiki is usually for things that are changing, and the page is written in that future style, so it makes one wonder if all things are finished or if some things remain unfinished

Re: Restricted Template Haskell

2015-02-02 Thread Greg Weber
skell.html [2] https://ghc.haskell.org/trac/ghc/wiki/TemplateHaskell/BlogPostChanges On Mon, Feb 2, 2015 at 11:31 AM, Greg Weber wrote: > Hi Simon, > > I am just starting the proposal: gathering interested parties and pointers > to related information. > Thanks for the pointer to

Re: Restricted Template Haskell

2015-02-02 Thread Greg Weber
Hi Simon, I am just starting the proposal: gathering interested parties and pointers to related information. Thanks for the pointer to Typed Template Haskell. I was actually unaware of the extent to which Typed Template Haskell is restricted. I have not seen any usage of Typed Template Haskell in

RE: Restricted Template Haskell

2015-02-02 Thread Simon Peyton Jones
More precision please! Simon From: Glasgow-haskell-users [mailto:glasgow-haskell-users-boun...@haskell.org] On Behalf Of Greg Weber Sent: 30 January 2015 23:39 To: ghc-d...@haskell.org; GHC users Cc: David Terei; Maxwell Swadling Subject: Restricted Template Haskell Hello GHC friends! I am st

Re: Restricted Template Haskell

2015-01-31 Thread Greg Weber
On Fri, Jan 30, 2015 at 7:05 PM, adam vogt wrote: > Hi Greg, > > Perhaps a less-invasive way to implement the -XSafe part of your > proposal would be to provide a module like: > > module Language.Haskell.TH.Safe ( > module Language.Haskell.TH, > reifyWithoutNameG, > ) where > import Languag

Re: Restricted Template Haskell

2015-01-30 Thread adam vogt
But I think that design would be a step in the direction of "harder to reason about" Regards, Adam On Fri, Jan 30, 2015 at 6:39 PM, Greg Weber wrote: > Hello GHC friends! > > I am starting up a proposal for variants of Template Haskell that restrict > what operations are

Restricted Template Haskell

2015-01-30 Thread Greg Weber
Hello GHC friends! I am starting up a proposal for variants of Template Haskell that restrict what operations are available. The goal is to make TH easier for users to reason about and to allow for an easier compilation story. Here is the proposal page: https://ghc.haskell.org/trac/ghc/wiki

Re: template haskell vs. -prof

2015-01-23 Thread Evan Laforge
On Sat, Jan 24, 2015 at 1:29 PM, John Lato wrote: > I mean to use a ghc that's been built without dynamic support. Oh, so if the whole compiler is not dynamic then TH no longer requires .dyn_o files? Interesting. I know they've put a lot of work into this and staging is hard, so I assume there

Re: template haskell vs. -prof

2015-01-23 Thread John Lato
On 21:23, Fri, Jan 23, 2015 Evan Laforge wrote: On Sat, Jan 24, 2015 at 2:38 AM, John Lato wrote: > I agree that mixing template haskell with -prof can be tricky. It's easier if you turn > off dynamic linking entirely. But that's the thing, I do turn of dynamic linking becau

Re: template haskell vs. -prof

2015-01-23 Thread Evan Laforge
On Sat, Jan 24, 2015 at 2:38 AM, John Lato wrote: > I agree that mixing template haskell with -prof can be tricky. It's easier > if you turn > off dynamic linking entirely. But that's the thing, I do turn of dynamic linking because I have to for -prof, but TH

Re: template haskell vs. -prof

2015-01-23 Thread John Lato
I agree that mixing template haskell with -prof can be tricky. It's easier if you turn off dynamic linking entirely. As for multi-line string literals, I also think that an explicit syntax would be nice. Until then, I usually use: unlines [ "Line 1" , "Li

template haskell vs. -prof

2015-01-23 Thread Evan Laforge
I ran into trouble compiling template haskell with -prof, and came across the ghc manual "7.9.4. Using Template Haskell with Profiling". Unfortunately I can't use its advice directly since I put profiling and non-profiling .o files into different directories. But in principle it

Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-24 Thread Dominic Steinitz
Thank you very much everyone. I now have a version of yarr which compiles under ghc 7.8.3. I have yet to do the conditional compilation hackery to support back versions but then I can make a release. What a great community :-) Dominic Steinitz domi...@steinitz.org http://idontgetoutmuch.wordpre

Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-24 Thread Francesco Mazzoli
I forgot to mention that `cpphs' can mimick gcc's cpp, with the flag `-cpp'. In Agda we have ghc-options: -pgmPcpphs -optP--cpp Francesco On 24 December 2014 at 10:50, Francesco Mazzoli wrote: > You can specify the pre-processor in the `ghc-options' field in the > cabal file, e.g. > >

Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-24 Thread Francesco Mazzoli
You can specify the pre-processor in the `ghc-options' field in the cabal file, e.g. ghc-options: -pgmPcpphs Francesco On 23 December 2014 at 17:14, Brandon Allbery wrote: > On Tue, Dec 23, 2014 at 11:10 AM, Dominic Steinitz > wrote: >> >> How very clever of you and thank you very much. Ch

Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-23 Thread Brandon Allbery
On Tue, Dec 23, 2014 at 11:10 AM, Dominic Steinitz wrote: > How very clever of you and thank you very much. Changing ‘ to 1 does fix > the problem. > > I would have thought this would work > > cabal install --with-gcc=gcc-4.9 > > > But sadly I still got the same error. > I think that changes the

Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-23 Thread Dominic Steinitz
leFloat#, geFloat#) > > > > then the module compiles but of course then the whole package does *not* > > compile. > > > > Did something change in 7.8.3 with regard to CPP (this code has not been > > modified for at least two years)? > > > > Thanks

Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-23 Thread Dominic Steinitz
How very clever of you and thank you very much. Changing ‘ to 1 does fix the problem. I would have thought this would work > cabal install --with-gcc=gcc-4.9 But sadly I still got the same error. Do I need a special version of cpphs? Dominic Steinitz domi...@steinitz.org http://idontgetoutmuc

Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-23 Thread Brandon Allbery
On Tue, Dec 23, 2014 at 10:46 AM, Dominic Steinitz wrote: > To restate the problem: this is from code that has not been changed for 2 > years. I get > > > Examples.hs:42:42: Parse error in pattern: con > > Failed, modules loaded: none. > I think I see the problem. Are you by any chance on a mach

Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-23 Thread Carter Schonwald
t; Thanks once again. > > > > Dominic Steinitz > > domi...@steinitz.org > > http://idontgetoutmuch.wordpress.com > > > > On 23 Dec 2014, at 13:42, Erik Hesselink wrote: > > > >> Hi Dominic, > >> > >> It looks like just a representat

CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-23 Thread Dominic Steinitz
>> >> It looks like just a representation change: a TySynEqn is a data type >> containing a [Type] and a Type, and those were the original two >> arguments. So it looks like with a little bit of CPP, you could >> support both versions. Something like >> >

Re: Irreducible predicates error in Template Haskell

2014-10-29 Thread Richard Eisenberg
wrote: > Hello, > > we were trying to reify a typeclass, which had a ConstraintKind and we hit > upon this error: "Can't represent irreducible predicates in Template > Haskell:". > > It seems that there is already a ghc bug [ > https://ghc.haskell.o

Irreducible predicates error in Template Haskell

2014-10-29 Thread Sreenidhi Nair
Hello, we were trying to reify a typeclass, which had a ConstraintKind and we hit upon this error: "Can't represent irreducible predicates in Template Haskell:". It seems that there is already a ghc bug [ https://ghc.haskell.org/trac/ghc/ticket/7021 ] filed and its status is se

Re: GADTs in implementation of Template Haskell

2014-10-21 Thread Gershom B
On October 20, 2014 at 2:35:27 PM, Richard Eisenberg (e...@cis.upenn.edu) wrote: > Having done so, I'm not 100% convinced that this is the right thing to do. I > would love feedback > on my full, concrete proposal available at > https://ghc.haskell.org/trac/ghc/wiki/Design/TemplateHaskellGADTs

GADTs in implementation of Template Haskell

2014-10-20 Thread Richard Eisenberg
I'm doing a bunch of bug-fixes / improvements to Template Haskell. Two of these are to fix GHC bugs #8100 (add standalone-deriving support) and #9064 (add `default` method type signature support), both of which introduce new constructors for `Dec`. This got me thinking about `Dec` and the

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-06 Thread Greg Weber
I created a GHC patch that spits out the generated Template Haskell code to a file with -dump-to-file -ddump-splices https://ghc.haskell.org/trac/ghc/ticket/9126 On Sat, Jul 5, 2014 at 8:18 PM, adam vogt wrote: > Zeroth takes the first approach. It only supports a subset of TH > (DecsQ s

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread adam vogt
, I was looking into it a little, and template haskell could > effectively be implemented by a pre-processor and a portable library > that is compiler independent. If one could get ghc to spit out the > template haskell source after it expands it then that can be fed to > jhc as a quick

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Luite Stegeman
I'm not sure I correctly understand your approach, but to have the template haskell reification work without any runtime communication with the compiler you'd have to include the entire typechecker state, at least for all names reachable from the splice (see http://hackage.haskell.o

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread John Meacham
the result you pass to the compiler. John On Sat, Jul 5, 2014 at 1:09 PM, Luite Stegeman wrote: > How would you do reification with that approach? > > > On Sat, Jul 5, 2014 at 9:59 PM, John Meacham wrote: >> >> Actually, I was looking into it a little, an

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Luite Stegeman
How would you do reification with that approach? On Sat, Jul 5, 2014 at 9:59 PM, John Meacham wrote: > Actually, I was looking into it a little, and template haskell could > effectively be implemented by a pre-processor and a portable library > that is compiler independent. If one

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread John Meacham
Actually, I was looking into it a little, and template haskell could effectively be implemented by a pre-processor and a portable library that is compiler independent. If one could get ghc to spit out the template haskell source after it expands it then that can be fed to jhc as a quick first pass

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Brandon Allbery
On Sat, Jul 5, 2014 at 1:34 PM, Carter Schonwald wrote: > does JHC support template haskell? Pretty sure TH is too closely tied to ghc. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Carter Schonwald
does JHC support template haskell? On Sat, Jul 5, 2014 at 12:02 PM, Scott Turner <2hask...@pkturner.org> wrote: > It installed and worked on my Nexus 5. > > On 2014-07-04 00:43, Dominick Samperi wrote: > > Hello John, > > I tried to install the Haskell demo Cube on my

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Scott Turner
l >>>> for it :) (and willing to help on concrete mechanical subtasks) >>>> >>>> >>>> On Wed, Jul 2, 2014 at 12:14 PM, Luite Stegeman >>>> wrote: >>>>> hi all, >>>>> >>>>> I've adde

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-04 Thread John Meacham
t;> >>>> wow, this is great work! >>>> >>>> If theres a clear path to getting the generic tooling into 7.10, i'm all >>>> for it :) (and willing to help on concrete mechanical subtasks) >>>> >>>> >>>> On Wed, Jul

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-04 Thread Luite Stegeman
On Thu, Jul 3, 2014 at 6:18 PM, Simon Peyton Jones wrote: > Luite > > > > I lack the bandwidth to respond at any technical depth, but I’d like to > make encouraging noises. If you can figure out a way to make GHC do these > things without making the compiler terribly complicated and making > ma

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-03 Thread Dominick Samperi
great work! >>> >>> If theres a clear path to getting the generic tooling into 7.10, i'm all >>> for it :) (and willing to help on concrete mechanical subtasks) >>> >>> >>> On Wed, Jul 2, 2014 at 12:14 PM, Luite Stegeman >>> w

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-03 Thread John Meacham
> wrote: >>> >>> hi all, >>> >>> I've added some code [1] [2] to GHCJS to make it run Template Haskell >>> code on node.js, rather than using the GHC linker. GHCJS has supported TH >>> for a long time now, but so far always relied on n

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-03 Thread Luite Stegeman
subtasks) >> >> >> On Wed, Jul 2, 2014 at 12:14 PM, Luite Stegeman >> wrote: >> >>> hi all, >>> >>> I've added some code [1] [2] to GHCJS to make it run Template Haskell >>> code on node.js, rather than using the GHC linke

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-03 Thread CJ van den Berg
Yes! This would definitely be of great interest to users of the Android cross compilers. It should be quite feasible to drive a TH runner process on a development device or emulator. Having genuine TH support would be a huge improvement to the usefulness of GHC in a cross compiling scenario. I wou

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-02 Thread Carter Schonwald
into 7.10, i'm all > for it :) (and willing to help on concrete mechanical subtasks) > > > On Wed, Jul 2, 2014 at 12:14 PM, Luite Stegeman > wrote: > >> hi all, >> >> I've added some code [1] [2] to GHCJS to make it run Template Haskell >>

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-02 Thread Carter Schonwald
es (packages) as native code, > which means packages like unix or Win32 show up somewhere, depending on the > host environment. This also limits our options in choosing JS-specific > packages. > - The Template Haskell code runs on the host environment, which might be > slightly di

GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-02 Thread Luite Stegeman
hi all, I've added some code [1] [2] to GHCJS to make it run Template Haskell code on node.js, rather than using the GHC linker. GHCJS has supported TH for a long time now, but so far always relied on native (host) code for it. This is the main reason that GHCJS always builds nativ

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-19 Thread Albert Y. C. Lai
On 14-02-18 10:44 PM, Carter Schonwald wrote: hey Albert, could you open a ticket on ghc Trac about the QuasiQuot thing? It is now https://ghc.haskell.org/trac/ghc/ticket/8805 ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org ht

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-18 Thread Carter Schonwald
hey Albert, could you open a ticket on ghc Trac about the QuasiQuot thing? On Tue, Feb 18, 2014 at 9:48 PM, Albert Y. C. Lai wrote: > The new dynamism is pretty nice! I even used GHC 7.6.3 to build > cabal-install 1.18, then played with PATH so that when I said "cabal > install mtl" it saw GHC

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-18 Thread Albert Y. C. Lai
The new dynamism is pretty nice! I even used GHC 7.6.3 to build cabal-install 1.18, then played with PATH so that when I said "cabal install mtl" it saw GHC 7.8. It correctly added -dynamic-too and built both *.a and *.so in one go. This is very user-friendly. Still, I observed a few oddities.

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-17 Thread Simon Marlow
TemplateHaskell is a requirement. Does this clear things up? My last message might give the impression some things aren't compiled dynamically, because I merely ambiguously referred to 'packages'. On Sun, Feb 9, 2014 at 2:37 PM, Austin Seipp wrote: It is correct that Template Ha

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread Austin Seipp
, Feb 9, 2014 at 2:37 PM, Austin Seipp wrote: > It is correct that Template Haskell now requires dynamic objects. > However, GHC can produce static and dynamic objects at the same time, > so you don't have to recompile a package twice (it's a big > optimization, basically). &g

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread Joachim Breitner
Hi, Am Sonntag, den 09.02.2014, 14:37 -0600 schrieb Austin Seipp: > There is one caveat, if I remember correctly: if a package uses > TemplateHaskell, it must declare it as such in the Cabal file. This is > because Cabal does not parse the source to detect if TemplateHaskell > is needed in the dep

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread Austin Seipp
It is correct that Template Haskell now requires dynamic objects. However, GHC can produce static and dynamic objects at the same time, so you don't have to recompile a package twice (it's a big optimization, basically). Furthermore, if TemplateHaskell is enabled as a requirement for

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread George Colpitts
Yes, in general I think the doc needs a section: Incompatible changes. The hope is that you can take the release and just work as usual but when (for good reasons as in this release) it is not true is is important to have such a section. Another case that needs to be there is how to compile so you

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread Carter Schonwald
Indeed. The problem is that many folks might have cabal config files that explicitly disable shared. (For the compile times!). They might need clear information about wiping that field. On Sunday, February 9, 2014, Brandon Allbery wrote: > On Sun, Feb 9, 2014 at 9:28 AM, Greg Horn > > > wrot

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread Brandon Allbery
On Sun, Feb 9, 2014 at 9:28 AM, Greg Horn wrote: > Is --enable-shared off by default? > It's supposed to be on by default in 7.8. That said, not sure how many people have played with ~/.cabal/config -- brandon s allbery kf8nh sine nomine associates allber...@gm

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread Greg Horn
t; View this message in context: > http://haskell.1045720.n5.nabble.com/7-8-1-template-haskell-and-dynamic-libraries-tp5743587p5743628.html > Sent from the Haskell - Glasgow-haskell-users mailing list archive at > Nabble.com. > ___ > Glasgow-has

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread harry
mpilation will have to be done with dynamic libraries, to avoid having to do it all a second time when the user tries to use templates. -- View this message in context: http://haskell.1045720.n5.nabble.com/7-8-1-template-haskell-and-dynamic-libraries-tp5743587p5743628.html Sent from the Haskell -

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread Michael Snoyman
On Sun, Feb 9, 2014 at 10:30 AM, harry wrote: > Carter Schonwald wrote > > Yes. (And thence ghc itself is then invoked with dynamic or dynamic-too) > > > >> The docs for 7.8.1 say "Template Haskell must now load dynamic object > >> files, > >> not

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-09 Thread harry
Carter Schonwald wrote > Yes. (And thence ghc itself is then invoked with dynamic or dynamic-too) > >> The docs for 7.8.1 say "Template Haskell must now load dynamic object >> files, >> not static ones". Does this mean that, if I'm using Template Haskell,

Re: 7.8.1, template haskell, and dynamic libraries

2014-02-08 Thread Carter Schonwald
Yes. (And thence ghc itself is then invoked with dynamic or dynamic-too) On Saturday, February 8, 2014, harry wrote: > The docs for 7.8.1 say "Template Haskell must now load dynamic object > files, > not static ones". Does this mean that, if I'm using Template Haskel

7.8.1, template haskell, and dynamic libraries

2014-02-08 Thread harry
The docs for 7.8.1 say "Template Haskell must now load dynamic object files, not static ones". Does this mean that, if I'm using Template Haskell, every package which the templates depend on have to be built with --enable-shared? -- View this message in context: http://has

RE: Proposal to extend FieldPat in Template Haskell

2013-01-30 Thread Simon Peyton-Jones
Diatchki Sent: 29 January 2013 21:25 To: GHC Users Mailing List; Eric Mertens Subject: Proposal to extend FieldPat in Template Haskell Hello, (sorry for the repost, I forgot to add a subject.) I was just doing some work with Template Haskell and I noticed that the AST does not have support for

Proposal to extend FieldPat in Template Haskell

2013-01-29 Thread Iavor Diatchki
Hello, (sorry for the repost, I forgot to add a subject.) I was just doing some work with Template Haskell and I noticed that the AST does not have support for record puns and wild-cards. I know that these could be desugared into ordinary record patterns but I think that it would be more

Re: Template Haskell

2012-08-14 Thread Mikhail Vorozhtsov
On 07/18/2012 07:25 PM, Simon Peyton-Jones wrote: Folks Mikhail has improved Template Haskell’s handling of INLINE pragmas, SPECIALISE pragmas, and RULES. I plan to commit his patch: http://hackage.haskell.org/trac/ghc/ticket/7064 Will the patch make it to 7.6? I have 6 unpublished libraries t

Re: Template Haskell

2012-07-30 Thread Simon Marlow
On 20/07/2012 03:33, Mikhail Vorozhtsov wrote: Hi Simon. On Wed, Jul 18, 2012 at 7:25 PM, Simon Peyton-Jones wrote: Mikhail has improved Template Haskell’s handling of INLINE pragmas, SPECIALISE pragmas, and RULES. I plan to commit his patch BTW, is there a reason why you use commit messages

Re: Template Haskell

2012-07-19 Thread Mikhail Vorozhtsov
Hi Simon. On Wed, Jul 18, 2012 at 7:25 PM, Simon Peyton-Jones wrote: > Mikhail has improved Template Haskell’s handling of INLINE pragmas, > SPECIALISE pragmas, and RULES. I plan to commit his patch BTW, is there a reason why you use commit messages to attribute other people's work instead of `g

Re: update to Template Haskell for rich kinds

2012-03-21 Thread José Pedro Magalhães
TH's > > Type datatype? > > > > Also, is the Constraint kind already in TH? If not, this might be a good > > time to add it too. > > > > > > Cheers, > > Pedro > > > > On Mon, Mar 19, 2012 at 03:09, Richard Eisenberg > <mailt

Re: update to Template Haskell for rich kinds

2012-03-20 Thread Richard Eisenberg
tuples) in TH's > Type datatype? > > Also, is the Constraint kind already in TH? If not, this might be a good > time to add it too. > > > Cheers, > Pedro > > On Mon, Mar 19, 2012 at 03:09, Richard Eisenberg <mailto:e...@seas.upenn.edu>> wrote: > &

Re: update to Template Haskell for rich kinds

2012-03-20 Thread José Pedro Magalhães
9, 2012 at 03:09, Richard Eisenberg wrote: > Hi all, > > I'm working on bringing Template Haskell up to speed with the new > extensions for polymorphic kinds and promoted data kinds. This requires a > few small, non-breaking changes to TH datatypes. I've

update to Template Haskell for rich kinds

2012-03-18 Thread Richard Eisenberg
Hi all, I'm working on bringing Template Haskell up to speed with the new extensions for polymorphic kinds and promoted data kinds. This requires a few small, non-breaking changes to TH datatypes. I've made a (short) wiki page at http://hackage.haskell.org/tra

Re: Error when building cabal package with template haskell configured for profiling

2012-01-27 Thread Bas van Dijk
On 27 January 2012 15:14, Felipe Almeida Lessa wrote: > On Fri, Jan 27, 2012 at 12:06 PM, Bas van Dijk wrote: >> $ cabal configure --ghc-options="-O2 -prof -auto-all -caf-all" > > Why aren't you using the specific options for profiling? > > $ cabal configure --help | grep profiling >  -p --enable

Re: Error when building cabal package with template haskell configured for profiling

2012-01-27 Thread Felipe Almeida Lessa
On Fri, Jan 27, 2012 at 12:06 PM, Bas van Dijk wrote: > $ cabal configure --ghc-options="-O2 -prof -auto-all -caf-all" Why aren't you using the specific options for profiling? $ cabal configure --help | grep profiling -p --enable-library-profiling Enable Library profiling --disable-libr

Error when building cabal package with template haskell configured for profiling

2012-01-27 Thread Bas van Dijk
Hello, I would like to profile a cabal package that contains template haskell code. However I get the following error: $ cabal configure --ghc-options="-O2 -prof -auto-all -caf-all" ... $ cabal build ... Dynamic linking required, but this is a non-standard build (eg. prof). Y

RE: accessing compilation parameters from template haskell

2011-09-16 Thread Simon Peyton-Jones
| Would making a template-haskell-ghc package make sense? Might be | overkill just for my requirement but there could be other things like | support for GHC-specific language extensions that might also logically | belong there. I don't know -- I don't know what it would look like. By

Re: accessing compilation parameters from template haskell

2011-09-16 Thread Ganesh Sittampalam
Would making a template-haskell-ghc package make sense? Might be overkill just for my requirement but there could be other things like support for GHC-specific language extensions that might also logically belong there. On 16/09/2011 08:21, Simon Peyton-Jones wrote: > The difficulty here is t

RE: accessing compilation parameters from template haskell

2011-09-16 Thread Simon Peyton-Jones
ell.org] On Behalf Of Ganesh Sittampalam | Sent: 16 September 2011 06:42 | To: GHC users | Subject: accessing compilation parameters from template haskell | | Hi, | | It would be useful to access the current compilation parameters or even | an entire RunGhc monad from inside a Template Haskell spli

accessing compilation parameters from template haskell

2011-09-15 Thread Ganesh Sittampalam
Hi, It would be useful to access the current compilation parameters or even an entire RunGhc monad from inside a Template Haskell splice. Is there any way to do this? The reason I want to do this is I'm using the ghc API at runtime to dynamically execute code, and I want both the dynami

Re: [Template-haskell] change in [d| |] and creating instances in template-haskell 2.7

2011-09-08 Thread Jeremy Shaw
Ah cool. I just patched the code so that it uses mkName explicitly for now since it is Happstack related code and I want it to work the most places possible. Thanks! - jeremy On Sep 8, 2011, at 12:07 PM, Simon Peyton-Jones wrote: | Yeah. I would expect this to work: | | inferBar2 :: Name

RE: [Template-haskell] change in [d| |] and creating instances in template-haskell 2.7

2011-09-08 Thread Simon Peyton-Jones
| Yeah. I would expect this to work: | | inferBar2 :: Name -> Q [Dec] | inferBar2 typeName = |[d| instance Bar $(conT typeName) where | bar _ = "sucker" | |] | | But I get the same error: | | inferBar2 'Bool |==> | show-test.hs:4:3-18 | instance Bar Bool

Re: [Template-haskell] change in [d| |] and creating instances in template-haskell 2.7

2011-09-08 Thread Jeremy Shaw
code pretty / easily readable. But, as you point out, making bar not be a fresh name there creates a 'special case'. So, that is not great either.. When you saw inferBar2, did you find it somewhat 'surprising' that it didn't work ? - jeremy User advice welc

RE: [Template-haskell] change in [d| |] and creating instances in template-haskell 2.7

2011-09-08 Thread Simon Peyton-Jones
It would be convenient; but another weirdness too. User advice welcome! Simon | -Original Message- | From: template-haskell-boun...@haskell.org [mailto:template-haskell- | boun...@haskell.org] On Behalf Of Jeremy Shaw | Sent: 07 September 2011 20:50 | To: template-hask...@haskell.org | Su

Template Haskell: onward and upward

2010-10-18 Thread Simon Peyton-Jones
Folks Following lots of feedback from users, especially at ICFP, I've evolved some proposals for Template Haskell, that should make it both more expressive, and more secure. http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal Do let me know what you think. Discussi

RE: Template Haskell and linking

2010-09-20 Thread Simon Peyton-Jones
...@haskell.org] On Behalf Of Jonas Almström Duregård Sent: 17 September 2010 21:48 To: glasgow-haskell-users@haskell.org Subject: Template Haskell and linking Hi GHC users! Does anyone know if an import that is only used by Template Haskell (i.e. not in "actual" code) is reflected i

Template Haskell and linking

2010-09-17 Thread Jonas Almström Duregård
Hi GHC users! Does anyone know if an import that is only used by Template Haskell (i.e. not in "actual" code) is reflected in the produced executable? Example: import LargeModule(thFunction) $thfunction ... Is LargeModule linked in the executable file? (Assume thFunction is not ref

Template Haskell reification of instances

2010-08-13 Thread Simon Peyton-Jones
Dear TH users In Template Haskell, it's not currently possible to say "give me all the instances of this class"; it's a long-standing feature request. Sam Anklesaria has come up with a design and implemented it. Before committing to it, I want to check that other Templa

Re: Annotations and Template Haskell

2010-03-15 Thread Bertram Felgenhauer
efault value. A second advantage is that an unused annotation does not add any clutter to the code at all -- it can be completely optional. So in my eyes this feature would be ideal for specifying exceptional handling of a few data types (or functions or constructors) from Template Haskell code. Of c

RE: Annotations and Template Haskell

2010-03-09 Thread Simon Peyton-Jones
users@haskell.org | Subject: Annotations and Template Haskell | | Hello, | | I'm wondering whether annotations [1] could be made available to | Template Haskell users as a ghc specific extension. | | Would that be feasible? Would it be useful? | | An example use would be annotating a t

Annotations and Template Haskell

2010-03-08 Thread Bertram Felgenhauer
Hello, I'm wondering whether annotations [1] could be made available to Template Haskell users as a ghc specific extension. Would that be feasible? Would it be useful? An example use would be annotating a type with a representation of a default value that could be used in generating inst

Re: Template Haskell pattern quotations

2010-02-04 Thread Brad Larsen
On Thu, Feb 4, 2010 at 5:47 AM, Sebastian Fischer wrote: > > On Feb 4, 2010, at 8:58 AM, Simon Peyton-Jones wrote: > >> Unless I have a sudden revelation I don't expect to implement pattern >> splices anytime soon. >> >> On the other hand, pattern *quasiquotes* are fine; they are run by the >> ren

RE: Template Haskell pattern quotations

2010-02-04 Thread Simon Peyton-Jones
| If I understand Brad correctly, then what he needs is what he called | pattern quotation rather than splicing. ... | | Is there a problem with adding support for pattern brackets on the | right-hand side of function definitions in order to simplify the | definition of quasi quoters? Oh, thank y

Re: Template Haskell pattern quotations

2010-02-04 Thread Sebastian Fischer
On Feb 4, 2010, at 8:58 AM, Simon Peyton-Jones wrote: Unless I have a sudden revelation I don't expect to implement pattern splices anytime soon. On the other hand, pattern *quasiquotes* are fine; they are run by the renamer before scope analysis is done. So you can certainly say

RE: Template Haskell pattern quotations

2010-02-03 Thread Simon Peyton-Jones
| My question: Are Template Haskell pattern quotations (i.e., [p| ... | |]) not implemented in GHC because they are rather tricky to | implement, or because there has not been demand for them? They are tricky! The trouble is that patterns *bind variables*. I don't know how to deal cl

Re: Template Haskell pattern quotations

2010-02-03 Thread Robert Greayer
icing. That's my non-expert take on the issue. On Wed, Feb 3, 2010 at 7:32 PM, Brad Larsen wrote: > I'll put my question at the very front of this message, and then give > the context. > > My question:  Are Template Haskell pattern quotations (i.e., [p| ... > |]) not imple

Template Haskell pattern quotations

2010-02-03 Thread Brad Larsen
I'll put my question at the very front of this message, and then give the context. My question: Are Template Haskell pattern quotations (i.e., [p| ... |]) not implemented in GHC because they are rather tricky to implement, or because there has not been demand for them? And now, the contex

Re: bug in template haskell (with recursion?)

2010-01-28 Thread Jake Wheat
Sorry for posting this on the wrong mailing list. I added the bug to the tracker here: http://hackage.haskell.org/trac/ghc/ticket/3845 ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgo

bug in template haskell (with recursion?)

2010-01-27 Thread Jake Wheat
] = [t|HNil|] $ ghc -c THBug1.hs THBug1.hs:12:61: GHC internal error: `foldThing' is not in scope during type checking, but it passed the renamer tcg_type_env of environment: [] In the expression: foldThing xs In the Template Haskell quotation [t| HCons (LVPai

RE: [Template-haskell] Querying the instances a data type implements

2010-01-18 Thread Simon Peyton-Jones
All: as Robert says, I keep meaning to close the template-haskell list altogether; but I am not sure how to do so. Jonathan: where did you find a pointer to the mailing list? I should remove those too. Returning to the question, sadly there's no way to do what you want right now. There

RE: [Template-haskell] How to extract name and type of exported functions in modules

2009-10-30 Thread Simon Peyton-Jones
| First I thought I would examine the source code of template-haskell | (more specifically qLocation and qReify) to figure out how to do it | but got stuck. Obviously I have still much to learn when it comes to | Haskell. | | Could someone explain how Quasi works? Have you read the paper

RE: [Template-haskell] How to extract name and type of exported functions in modules

2009-10-21 Thread Simon Peyton-Jones
| -- If it exports any prelude indentifiers (not only the Prelude itself, |but also for example Data.List), I have no idea how to get at |their types --- lookupGlobalName does not find them. Well, it claims that it should find them. Would you like to make a reproducible test case and fi

  1   2   >