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
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
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
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
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
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
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
{-# 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
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
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
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
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
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
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
> 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)
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
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
> 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
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
> 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
..
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
>>>>> "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
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.
>
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
-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
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.
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
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'
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
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
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
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))
> >
32 matches
Mail list logo