[Haskell-cafe] package to expand TH macros?

2012-07-01 Thread Eric
I seem to remember finding a package a few days ago that would take Haskell source with TH, then run and expand the TH macros in-place to produce equivalent, TH-free Haskell source.   I just went through the Hackage package list and didn't find anything like that. Did I imagine it?  Or can

Re: [Haskell-cafe] package to expand TH macros?

2012-07-01 Thread Brandon Allbery
On Sun, Jul 1, 2012 at 1:56 PM, Eric devnull1...@yahoo.com wrote: I seem to remember finding a package a few days ago that would take Haskell source with TH, then run and expand the TH macros in-place to produce equivalent, TH-free Haskell source. It is kinda hard to find for some reason

Re: [Haskell-cafe] package to expand TH macros?

2012-07-01 Thread Chaddaï Fouché
On Sun, Jul 1, 2012 at 8:11 PM, Brandon Allbery allber...@gmail.com wrote: On Sun, Jul 1, 2012 at 1:56 PM, Eric devnull1...@yahoo.com wrote: I seem to remember finding a package a few days ago that would take Haskell source with TH, then run and expand the TH macros in-place to produce

Re: [Haskell-cafe] How to use cabal macros in .hsc files

2011-08-11 Thread Henning Thielemann
On 08.08.2011 12:08, Bas van Dijk wrote: Hello, Currently it's not possible to use cabal macros like MIN_VERSION_base(x,y,z) in .hsc files: http://hackage.haskell.org/trac/hackage/ticket/870 Is there a workaround to get the same effect? Writing a plain Haskell module that contains the code

[Haskell-cafe] How to use cabal macros in .hsc files

2011-08-08 Thread Bas van Dijk
Hello, Currently it's not possible to use cabal macros like MIN_VERSION_base(x,y,z) in .hsc files: http://hackage.haskell.org/trac/hackage/ticket/870 Is there a workaround to get the same effect? Regards, Bas ___ Haskell-Cafe mailing list Haskell

[Haskell-cafe] Need some help with Alex macros

2009-10-04 Thread Niklas Broberg
Hi all, I'm going crazy trying to get Alex to do what I want. I have the following regexp macros: @octEscape = [0123]? $octdig{1,2} @hexEscape = 'u' $hexdig{4} @charEscape = '\\' (@octEscape | @hexEscape | b | t | n | f | r | \ | \') and the following rules: \' (. # [\'\\] | @charEscape

[Haskell-cafe] Questions about haskell CPP macros

2009-07-13 Thread Matthew Elder
Hello Cafe, I am trying to improve the error reporting in my sendfile library, and I know I can find out the current file name and line number with something like this: {-# LANGUAGE CPP #-} main = putStrLn (__FILE__ ++ : ++ show __LINE__) This outputs: test.hs:2 Unfortunately, if your file is

Re: [Haskell-cafe] Questions about haskell CPP macros

2009-07-13 Thread Claus Reinke
macros for package and module when compiling the source? Any help is appreciated! For actually making use of such information, see http://hackage.haskell.org/trac/ghc/wiki/ExplicitCallStack http://hackage.haskell.org/trac/ghc/wiki/ExplicitCallStack/StackTraceExperience and also

Re: [Haskell-cafe] Questions about haskell CPP macros

2009-07-13 Thread Stephan Friedrichs
Matthew Elder wrote: {-# LANGUAGE CPP #-} main = putStrLn (__FILE__ ++ : ++ show __LINE__) This outputs: test.hs:2 Unfortunately, if your file is in a hierarchy of folders, this flat file name doesn't give much context. Is there a macro to find out the current module? IE if I had a

Re: [Haskell-cafe] Questions about haskell CPP macros

2009-07-13 Thread Malcolm Wallace
{-# LANGUAGE CPP #-} main = putStrLn (__FILE__ ++ : ++ show __LINE__) This outputs: test.hs:2 if I had a module Foo.Bar.Car.MyModule, I would like to be able to output something like this on error: Foo.Bar.Car.MyModule:2 It works for me. If you place that text in Try/Me.hs and call

Re: [Haskell-cafe] Questions about haskell CPP macros

2009-07-13 Thread Stephan Friedrichs
Malcolm Wallace wrote: {-# LANGUAGE CPP #-} main = putStrLn (__FILE__ ++ : ++ show __LINE__) This outputs: test.hs:2 if I had a module Foo.Bar.Car.MyModule, I would like to be able to output something like this on error: Foo.Bar.Car.MyModule:2 It works for me. If you place that text

[Haskell-cafe] hsc2hs: expanding macros in the .hsc file

2008-05-13 Thread Olivier Boudry
Hi all, Is it possible to expand macros defined in includes into the .hsc file? I'm trying to call functions from a library written in C. The library can be used with or without Unicode chars, depending on #define instructions. The library has macros for all the standard functions used to work

[Haskell-cafe] Hugs CPP macros?

2005-04-05 Thread John Goerzen
Hi, I need to use some conditional compilation in MissingH so that it can work with GHC 6.2, 6.4, and the old/new Hugs libraries. I found the appropriate macros to test for with ghc, but I can't for Hugs. The cpphs-hugs doesn't even define __HUGS__. It seems that only hugs-hc and ffihugs

[Haskell-cafe] Syntax macros

2004-05-15 Thread Doaitse Swierstra
We have all the machinery available. See: http://www.cs.uu.nl/groups/ST/Center/SyntaxMacros It will be part of the UtrechtHaskellCompiler (UHC), that is being constructed with our toolset, and which recently strated to produce running code. You get the syntax macros almost for free if you build

Re: Macros[by implementor of toy compiler]

2001-05-08 Thread Alan Bawden
Date: Mon, 7 May 2001 17:48:47 +0200 (CEST) From: Michal Gajda [EMAIL PROTECTED] * Introduction of general hygienic macro's as you propose, forces us to cope with following problems: 1. Full typechecking of macros(in place of definition) seems to need second-rank polymorphism

Re: Macros[by implementor of toy compiler]

2001-05-08 Thread Keith Wansbrough
2. Macros make the parsed grammar dynamic. Usually compiler has hard-coded parser generated by LALR parser generator(like Happy or Yacc) compiled in. Introducing each macro like you proposed would need(I think) generating new parser(at least for the fragment of the grammar). Dylan has macros

Re: Macros (Was: Interesting: Lisp as a competitive advantage)

2001-05-07 Thread Jerzy Karczmarczuk
Keith Wansbrough quotes : Jerzy Karczmarczuk [EMAIL PROTECTED] writes: Macros in Scheme are used to unfold n-ary control structures such as COND into a hierarchy of IFs, etc. Nothing (in principle) to do with laziness or HO functions. Isn't this exactly the reason that macros

RE: Macros

2001-05-07 Thread Simon Marlow
Simon Marlow wrote: Well, simply extending the Haskell syntax to allow \ p11 .. p1n - e1 .. pm1 .. pmn - em (with appropriate layout) should be ok, but I haven't tried it. Guarded right-hand-sides could be allowed too. Introducing layout after

Re: Macros[by implementor of toy compiler]

2001-05-07 Thread Michal Gajda
On Fri, 4 May 2001, Alan Bawden wrote: (...) But I think that in many circumstances macros do such a good job that I don't see the need to clutter up the language with the special-prupose features needed to replace them. (...) I'm currently making fun by writing compiler from eager lambda

Macros

2001-05-06 Thread Alan Bawden
heartily at this apt analogy. I have heard vice grips described as the wrong tool for every job. (My own experience with vice grips backs this up). I considered including that well-known quip in the paragraph where I tried to make it clear that I was -not- saying the same thing about macros

Macros

2001-05-05 Thread Richard
Norman Ramsey writes: When I compare Lisp and Haskell, the big question in my mind is this: is lazy evaluation sufficient to make up for the lack of macros? it might make sense for Haskell to have a facility that makes it possible for the programmer to define new bits of syntactic sugar without

Re: Macros (Was: Interesting: Lisp as a competitive advantage)

2001-05-05 Thread Fergus Henderson
On 04-May-2001, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote: Jerzy Karczmarczuk [EMAIL PROTECTED] pisze: In Clean there are macros. They are rather infrequently used... I think they roughly correspond to inline functions in Haskell. They are separate in Clean because module

Re: Macros (Was: Interesting: Lisp as a competitive advantage)

2001-05-04 Thread Keith Wansbrough
Jerzy Karczmarczuk [EMAIL PROTECTED] writes: Macros in Scheme are used to unfold n-ary control structures such as COND into a hierarchy of IFs, etc. Nothing (in principle) to do with laziness or HO functions. Isn't this exactly the reason that macros are less necessary in lazy languages

Macros

2001-05-04 Thread Jan-Willem Maessen
simple instance declarations. As you can probably guess, I think (3) and (4) are the most profitable avenues of exploration. And I'm pretty sure I _don't_ want syntax macros for these. I'm still waiting to be convinced what I do want. -Jan-Willem Maessen Eager Haskell project [EMAIL PROTECTED