RE: [Template-haskell] Profiling with Template Haskell

2003-08-07 Thread Sean Seefried
Hi Simon, > Hmm, yes good point. GHC compiles different binaries for profiled and > non-profiled execution. Splice code that runs at compile time should > presumably be non-profiled (though I'm sure someone will want to > profile it too). So TH should link non-profiled libraries at compile > ti

Template Haskell

2002-11-26 Thread Mike Thomas
Hi there. Could somebody please let me know where I've gone wrong in the program below (yesterday's CVS HEAD stage 3 compiler on Windows)? - TH - printf.hs --- module Main where import Language.Haskell.THSyntax data Format = D | S | L String main = putStrLn ( $(pr "Hello") ) pars

Template Haskell...

2003-10-29 Thread MR K P SCHUPKE
Okay, I have got my template working, but its extremely unreadable... could anyone tell me how to make this look more like normal Haskell code? stringType :: String -> Q [Dec] stringType s = do x <- gensym "x" return [ Newtype [] s [] (Constr s [(NonStrict,Tcon (TconName "String"))])

Template Haskell...

2003-10-30 Thread MR K P SCHUPKE
Just a thought, but once you have a data structure representing reified code there is a couple of things it would be nice to be able to do: 1) use the Parser to read a source file (i'm assuming the parser produces the same data stuctures as template haskell) 2) run the reified code dir

Template Haskell...

2003-10-31 Thread MR K P SCHUPKE
With reference to the future of template haskell - it would be nice if you could express the following: stringType :: String -> Q [Dec] stringType s = do x <- gensym "x" y <- gensym "y" return [ Newtype [] s [] (Constr s [(Strict,Tcon (TconName "

Template Haskell...

2004-10-20 Thread MR K P SCHUPKE
What replaces 'gensym' in GHC 6.3? Keean. ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

template haskell syntax

2007-08-24 Thread Christian Maeder
Hi, for haskell prime I suggest to change the stolen syntax "[e|", "[p|", "[d|", "[t|" to [|| in order to avoid the confusion with list comprehensions. Cheers Christian ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://ww

Template Haskell documentation

2007-11-07 Thread Richard Giraud
Hello I'm trying to learn how to use Template Haskell and I'm finding that the documentation is sparse. In particular, the constructors for Dec, Exp, Con, etc. in Language.Haskell.TH.Syntax aren't explained. Would documentation patches be welcomed for this library? T

RE: Template Haskell

2002-11-27 Thread Simon Peyton-Jones
ge- | From: Mike Thomas [mailto:[EMAIL PROTECTED]] | Sent: 27 November 2002 06:19 | To: [EMAIL PROTECTED] | Subject: Template Haskell | | Hi there. | | Could somebody please let me know where I've gone wrong in the program below | (yesterday's CVS HEAD stage 3 compiler on Windows)? |

Re: Template Haskell

2002-11-27 Thread Mike Thomas
Thanks Simon. > If you look in the manual you'll see that it says you can only > compile-time-call a function that is in a separate module. So put > 'pr/gen/parse' in a separate module and you'll be fine. My fault really as I only have the raw SGML and it sends me up the wall to try and read it.

Template Haskell reification

2003-01-05 Thread Sean Seefried
Why is it that one can't reify top level function declarations? At the moment it only seems that we can reify type declarations. No immediate reason for this seems to spring to mind, but there may be one. Thanks, Sean ___ Glasgow-haskell-users maili

Re: Template Haskell...

2003-10-29 Thread Alastair Reid
Expressions: \ x1 ... xn -> ... let x = e in ... case e of { (x1,...xn) -> ... } f e1 ... en I posted some (in the hope that they'd make it into a standard library) here: http://www.haskell.org/pipermail/template-haskell/2003-September/000176.html And, of course, the TH lib

RE: Template Haskell...

2004-10-20 Thread Simon Peyton-Jones
: Template Haskell... | | | What replaces 'gensym' in GHC 6.3? | | Keean. | ___ | Glasgow-haskell-users mailing list | [EMAIL PROTECTED] | http://www.haskell.org/mailman/listinfo/glasgow-has

RE: Template Haskell...

2004-10-20 Thread MR K P SCHUPKE
Thanks for the URL... I have realised I jumped the gun saying the derivation can be done in template-haskell... there is one small problem: $(derive [t| SomeConstructor a b |]) passes the constructor to derive... is there any way to get the type information for some type? You can do $(derive

Re: Template Haskell...

2004-10-21 Thread Ulf Norell
MR K P SCHUPKE wrote: Thanks for the URL... I have realised I jumped the gun saying the derivation can be done in template-haskell... there is one small problem: $(derive [t| SomeConstructor a b |]) passes the constructor to derive... is there any way to get the type information for some type

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: 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-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

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

Template Haskell crashes unexpectedly...

2006-08-21 Thread Brian Hulley
Hi, I'm starting to explore Template Haskell and I've got the following program: -- almost directly from "Template meta-programming in Haskell" paper module Duma.Template.Test ( Format(..) , printf ) where import

Data.Generics vs. Template Haskell

2006-08-24 Thread Vyacheslav Akhmechet
I am trying to figure out where these two libraries stand in relation to each other and which one is preferred to do generic programming in Haskell. I understand that their goals often intersect but couldn't find any good comparisons. Could someone point me in the right direction? Thanks, - Slava

Template Haskell quotion for []

2006-11-07 Thread Krasimir Angelov
Hello, I had this example that was working with earliest versions of GHC but it doesn't work with GHC-6.6. $(deriveReflectable ''[]) Above this isn't a double quote but two single quotes. It may not be clear with some fonts. Is this a bug or just there is a change in the syntax? The error that

Template Haskell [d| .. trouble

2007-06-16 Thread Marc Weber
Hi. I've started using template haskell (replacing some preprocessor stuff) However I had real trouble when trying to convert instance (Show d) => Show (C d) where show _ = "C " ++ (show (undefined :: d)) into th. Why? It didn't compile (http://hpaste.org/289)

RE: Template Haskell documentation

2007-11-07 Thread Simon Peyton-Jones
iraud | Sent: 07 November 2007 15:25 | To: GHC Users Mailing List | Subject: Template Haskell documentation | | Hello | | I'm trying to learn how to use Template Haskell and I'm finding that the | documentation is sparse. In particular, the constructors for Dec, Exp,

Re: Template Haskell documentation

2007-11-07 Thread Alfonso Acosta
Hi Richard, > I'm trying to learn how to use Template Haskell and I'm finding that the > documentation is sparse. In particular, the constructors for Dec, Exp, > Con, etc. in Language.Haskell.TH.Syntax aren't explained. Yes, absolutely true. I myself had to look at the s

RE: Template Haskell reification

2003-01-06 Thread Simon Peyton-Jones
| Why is it that one can't reify top level function declarations? At the | moment it only seems that we can reify type declarations. No immediate | reason for this seems to spring to mind, but there may be one. [I'm interested to know something about your application, incidentally.] Several reas

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: 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

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-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-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 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-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

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

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

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

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

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
| 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
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 crashes unexpectedly...

2006-08-21 Thread Arie Peterson
Hello Brian, > [snip] > getInfo :: Q Info > getInfo = reify (mkName "Car") > [snip] > -- Crashes if I try to print out the info > -- info <- runQ getInfo > -- putStrLn (pprint info) > [snip] > > The example from the paper works fine with the few

Re: Template Haskell crashes unexpectedly...

2006-08-21 Thread Bulat Ziganshin
Hello Brian, Monday, August 21, 2006, 6:34:06 PM, you wrote: > -- almost directly from "Template meta-programming in Haskell" paper i should warn you that some TH details was changed in 6.4. these changes described in second TH paper and afair, reifying is among them look at www.haskell.

Re: Template Haskell crashes unexpectedly...

2006-08-21 Thread Brian Hulley
Bulat Ziganshin wrote: Hello Brian, Monday, August 21, 2006, 6:34:06 PM, you wrote: -- almost directly from "Template meta-programming in Haskell" paper i should warn you that some TH details was changed in 6.4. these changes described in second TH paper and afair, reifying is among t

Re: Template Haskell crashes unexpectedly...

2006-08-21 Thread Brian Hulley
Arie Peterson wrote: I seem to remember that 'reify' cannot be run in the IO monad. IIRC ghci gives a nice error message saying this, so perhaps you can try to execute 'main' from within ghci to corroborate my suspicion. Yes you're right - ghci gives the error: "Can't do `reify' in the IO m

Re: Data.Generics vs. Template Haskell

2006-08-24 Thread Vyacheslav Akhmechet
-- Forwarded message -- From: Vyacheslav Akhmechet <[EMAIL PROTECTED]> Date: Aug 24, 2006 5:35 PM Subject: Re: Data.Generics vs. Template Haskell To: Bulat Ziganshin <[EMAIL PROTECTED]> Ok, so there are two aspects that I can see here. One such aspect is ability to

Re: Data.Generics vs. Template Haskell

2006-08-24 Thread Bulat Ziganshin
Hello Vyacheslav, Thursday, August 24, 2006, 11:51:46 PM, you wrote: > I am trying to figure out where these two libraries stand in relation > to each other and which one is preferred to do generic programming in > Haskell. I understand that their goals often intersect but couldn't > find any goo

Re: Data.Generics vs. Template Haskell

2006-08-24 Thread Chris Kuklewicz
Bulat Ziganshin wrote: Hello Vyacheslav, Thursday, August 24, 2006, 11:51:46 PM, you wrote: I am trying to figure out where these two libraries stand in relation to each other and which one is preferred to do generic programming in Haskell. I understand that their goals often intersect but cou

Re: Data.Generics vs. Template Haskell

2006-08-24 Thread skaller
On Fri, 2006-08-25 at 00:53 +0400, Bulat Ziganshin wrote: > Hello Vyacheslav, > > Thursday, August 24, 2006, 11:51:46 PM, you wrote: > > > I am trying to figure out where these two libraries stand in relation > > to each other and which one is preferred to do generic programming in > > Haskell. I

RE: Template Haskell [d| .. trouble

2007-06-21 Thread Simon Peyton-Jones
| I've started using template haskell (replacing some preprocessor stuff) | | However I had real trouble when trying to convert | instance (Show d) => Show (C d) | where show _ = "C " ++ (show (undefined :: d)) This isn't a bug. Haskell 98 doesn't have sc

Another question regarding Template Haskell

2003-01-12 Thread Sean Seefried
xpressions. Sean Seefried p.s. If I'm posting to the wrong group, I apologise, it's just that template-haskell doesn't seem to be a mail group just yet. I've posted to it and haven't seen any of my postings appear yet. _

classes and template haskell (bug?)

2003-12-30 Thread Jeremy Shaw
Hello, I have loaded the following from a file into ghci 6.2: module Main where import Language.Haskell.THSyntax class Test a where test :: a -> a instance Test (a,b,c) where test x = x main = putStrLn "Hello, World!" This works for me: *Main> runQ [d| instance Test (Int,Int) |] >>

template-haskell names in 6.3

2004-10-22 Thread MR K P SCHUPKE
I have now read most of the notes on template-haskell2, but I still have a problem with naming (although I think my issues with types are adequately dealt with by the '' notation. I wish to create a declaration in template haskell, where the funtion name is supplied: something like

template haskell printf doesn't compile...

2004-12-03 Thread S. Alexander Jacobson
Tried to use the printf TH example described in the GHC docs http://www.haskell.org/ghc/docs/latest/html/users_guide/template-haskell.html Got this error: Chasing modules from: PrintMain.hs Compiling Printf ( ./Printf.hs, ./Printf.o ) ./Printf.hs:23: Type constructor or class no

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

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
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 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 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

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-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-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 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: 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

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

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: 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: 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[2]: Template Haskell crashes unexpectedly...

2006-08-21 Thread Bulat Ziganshin
plices and this instance used when you run computations in Q monad inside your program, at run-time, using runQ operation: instance Quasi IO where qNewName s = do { n <- readIORef counter ; writeIORef counter (n+1) ; return (mkNameU s n) } qReport Tr

Re[4]: Template Haskell crashes unexpectedly...

2006-08-22 Thread Bulat Ziganshin
Hello Brian, Tuesday, August 22, 2006, 1:16:08 AM, you wrote: > The solution seems to be something like: > $(extend_data [d| > data D = X {f::Int, g::String} > |]) > $(extend_instance [d| > instance Obj D where > ... > |]) or just

Using Template Haskell for deriving instances

2003-07-15 Thread Carsten Schultz
Hi, is any workable example code for using Template Haskell to generate instance declarations available, eg the function `genEq' mentioned in the Template Haskell paper? Greetings, Carsten -- Carsten Schultz (2:40, 33:47), FB Mathematik, FU Berlin http://carsten.fu-mathe-team.de/ PGP/GP

Template Haskell and the command line

2003-12-02 Thread George Russell
Template Haskell is frightfully good and we want to get rid of cpp and use it instead, but there's one tiny problem, namely that for cpp it is possible to define variables on the command line (-DSIMON=MARLOW and so on) while with Template Haskell it doesn't seem to be. Could there be so

RE: classes and template haskell (bug?)

2003-12-31 Thread Simon Peyton-Jones
In GHC 6.2, Template Haskell has various bugs. I think they are all fixed in the HEAD, so you can either build from source or grab a development snapshot from the GHC site. The HEAD version of TH has a slightly different programming interface too -- see http://research.microsoft.com

Re: classes and template haskell (bug?)

2003-12-31 Thread Jeremy Shaw
19309.html http://www.haskell.org/pipermail/cvs-ghc/2003-December/019313.html I am enjoying template haskell so far (despites the bugs), and the changes since 6.0 are pretty nice! I find the naming scheme in THSyntax.hs in 6.2 much easier to read than in 6.0. Thanks! Jeremy Shaw. At Wed, 31 Dec

Re: classes and template haskell (bug?)

2004-01-01 Thread Jeremy Shaw
pT (AppT (TupleT 2) (ConT GHC.Base.Int)) (ConT GHC.Base.Int))) []] *Main> runQ [d| instance Test (a,b) |] >>= putStrLn . show *** Exception: basicTypes/Var.lhs:226:32-58: Non-exhaustive patterns in record update Jeremy Shaw. At Wed, 31 Dec 2003 08:11:47 -0000, Simon Peyton-Jones wrote: > &

Re: classes and template haskell (bug?)

2004-01-02 Thread Sven Panne
Jeremy Shaw wrote: I attempted to build cvs head but it died with the following error: /usr/bin/ghc6 -H16m -O -istage1/utils -istage1/basicTypes -istage1/types -istage1/hsSyn -istage1/prelude -istage1/rename -istage1/typecheck -istage1/deSugar -istage1/coreSyn -istage1/specialise -istag

RE: classes and template haskell (bug?)

2004-01-05 Thread Simon Peyton-Jones
users- | [EMAIL PROTECTED] On Behalf Of Jeremy Shaw | Sent: 02 January 2004 04:35 | To: [EMAIL PROTECTED] | Subject: Re: classes and template haskell (bug?) | | Hello, | | No dice. Using cvs head from 12/31, I get the same behavior, (plus a | new bug). Using the same test as before (after updatin

RE: template haskell printf doesn't compile...

2004-12-03 Thread Simon Peyton-Jones
2004 20:21 | To: GHC users | Subject: template haskell printf doesn't compile... | | Tried to use the printf TH example described in | the GHC docs | | http://www.haskell.org/ghc/docs/latest/html/users_guide/template-haskell .html | | Got this error: | | Chasing modules from: PrintMa

RE: template haskell printf doesn't compile...

2004-12-03 Thread S. Alexander Jacobson
> > | -Original Message- > | From: [EMAIL PROTECTED] > [mailto:glasgow-haskell-users- > | [EMAIL PROTECTED] On Behalf Of S. Alexander Jacobson > | Sent: 02 December 2004 20:21 > | To: GHC users > | Subject: template haskell printf doesn't compile... > | > |

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

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

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

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

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: Re[2]: Template Haskell crashes unexpectedly...

2006-08-21 Thread Brian Hulley
Bulat Ziganshin wrote: as you can see, it don't supports reification, recovery and information about currently compiled module just because there is no such information when program runs. and of course, you can't add new fields or new functions at run-time. isntead typical technique is: $(transf

Why doesn't this Template Haskell program work?

2003-01-12 Thread Sean Seefried
g program, import Language.Haskell.THSyntax main = putStrLn (show $(tup [lift 'a', lift 'b'])) ---- it works just fine. Also, is the template-haskell mailing list active? Sean Seefried ___ Glasgow-haskell-users mailing list

Re: Using Template Haskell for deriving instances

2003-07-15 Thread Derek Elkins
On Tue, 15 Jul 2003 14:49:41 +0200 Carsten Schultz <[EMAIL PROTECTED]> wrote: > Hi, > > is any workable example code for using Template Haskell to generate > instance declarations available, eg the function `genEq' mentioned in > the Template Haskell paper? This is

RE: Template Haskell and the command line

2003-12-08 Thread Simon Marlow
> Template Haskell is frightfully good and we want to get rid of cpp and > use it instead, but there's one tiny problem, namely that for cpp it > is possible to define variables on the command line > (-DSIMON=MARLOW and so > on) while with Template Haskell it doesn't se

RE: Template Haskell and the command line

2003-12-18 Thread Simon Peyton-Jones
DEBUG=yes ghc -fth Foo.hs Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:glasgow-haskell-users- | [EMAIL PROTECTED] On Behalf Of George Russell | Sent: 02 December 2003 15:32 | To: [EMAIL PROTECTED] | Subject: Template Haskell and the command line | | Template Ha

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: 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

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-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
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 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 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 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 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 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 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
, 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

  1   2   >