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 wrote: > On Sun, Jul 1, 2012 at 1:56 PM, Eric 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 equival

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

2012-07-01 Thread Brandon Allbery
On Sun, Jul 1, 2012 at 1:56 PM, Eric 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... yo

[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?  O

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

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

[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

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

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

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

2009-07-13 Thread Claus Reinke
ghc, to define appropriate 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

[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

[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

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

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

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)

Re: Macros[by implementor of toy compiler]

2001-05-07 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

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 wr

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

Re: Macros

2001-05-07 Thread Andreas Rossberg
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 \ wil

RE: Macros

2001-05-07 Thread Simon Marlow
> Today I ran across exactly your case. In non-pure languages you would > just write 'case foo of'. I would be happy with just 'function': > > get >>= function > ... -> ... > ... -> ... Well, simply extending the Haskell syntax to allow \ p11 .. p1n -> e1 ..

Re: Macros

2001-05-07 Thread Ronny Wichers Schreur
Marcin 'Qrczak' Kowalczyk schrijft: >I think [Clean macros] roughly correspond to inline functions >in Haskell. That's right. I think the most important difference is that Clean macros can also be used in patterns (if they don't have a lower case name or contain loc

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

2001-05-07 Thread Michael Sperber [Mr. Preprocessor]
>>>>> "Keith" == Keith Wansbrough <[EMAIL PROTECTED]> writes: Keith> 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 princ

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

Re: Macros

2001-05-06 Thread Marcin 'Qrczak' Kowalczyk
Sat, 5 May 2001 04:44:15 -0700 (PDT), Richard <[EMAIL PROTECTED]> pisze: > eg, I recently wanted > > case2 foo of ... > > as sugar for > > foo >>= \output-> > case output of ... Yes, often miss OCaml's 'function' and SML's 'fn' syntax which allow dispatching without inventing a tempora

Macros

2001-05-06 Thread Alan Bawden
-not- saying the same thing about macros. (While looking for a good online picture of vise-grips I came across a number of vise-grip horror stories -- the best was the guy who replaced the steering wheel in his car with a pair of vise-grips! But I digress...) So just to reiterate: the property of

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.

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

Macros

2001-05-04 Thread Jan-Willem Maessen
at I most long for, though, is the ability to synthesize new types and new classes---not just 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'

Macros

2001-05-04 Thread Alan Bawden
le, but are there any other uses for such quoting? There are a few. But this isn't the -only- reason to still use macros. We could systematically go through all the macros I've written in the last few years, and for each one we could figure out what language feature would be needed in or

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

2001-05-04 Thread Marcin 'Qrczak' Kowalczyk
Fri, 04 May 2001 12:57:29 +0200, 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 interfaces are written by hand, so

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 necessa

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

2001-05-04 Thread Jerzy Karczmarczuk
Discussion about macros, Lisp, laziness etc. Too many people to cite. Alan Bawden uses macros to write assertions, and Dylan Thurston comments: ... > > (assert (< x 3)) > > > > Which macro expands into: > > > > (if (not (< x 3)) > >