Jake Wheat | 2 Oct 12:12 2012
Picon

Data.Text and quasi quoting

Hello,

I have a parser which parses to an ast which contains Text values. I
am trying to use this parser with quasiquoting, but the implementation
of Data for Text is incomplete. I've attached a smallish test case,
when I try to compile Text.hs I get:

Text.hs:17:9:
    Exception when trying to run compile-time code:
      Data.Text.Text.toConstr
      Code: Language.Haskell.TH.Quote.quoteExp expr " test "

Is there a way to get this working?

Thanks,
Jake.
Attachment (Parser.hs): text/x-haskell, 1454 bytes
Attachment (Quasi.hs): text/x-haskell, 751 bytes
Attachment (Syntax.hs): text/x-haskell, 210 bytes
Attachment (Text.hs): text/x-haskell, 265 bytes
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Dmitry Olshansky | 3 Oct 07:23 2012
Picon

Re: Data.Text and quasi quoting

Hello,


if you change from
> test2 = [expr| test |]
to
> test2 = [expr| $test |]
then it will be compile.

Do you want that or what?





2012/10/2 Jake Wheat <jakewheatmail <at> gmail.com>
Hello,

I have a parser which parses to an ast which contains Text values. I
am trying to use this parser with quasiquoting, but the implementation
of Data for Text is incomplete. I've attached a smallish test case,
when I try to compile Text.hs I get:

Text.hs:17:9:
    Exception when trying to run compile-time code:
      Data.Text.Text.toConstr
      Code: Language.Haskell.TH.Quote.quoteExp expr " test "

Is there a way to get this working?

Thanks,
Jake.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Jake Wheat | 3 Oct 10:03 2012
Picon

Re: Data.Text and quasi quoting

No, that's not the problem. I want to parse with more complicated asts
containing both Text and antiquotes.

On Wed, 3 Oct 2012 09:23:15 +0400
Dmitry Olshansky <olshanskydr <at> gmail.com> wrote:

> Hello,
> 
> if you change from
> > test2 = [expr| test |]
> to
> > test2 = [expr| $test |]
> then it will be compile.
> 
> Do you want that or what?
> 
> 
> 
> 
> 
> 2012/10/2 Jake Wheat <jakewheatmail <at> gmail.com>
> 
> > Hello,
> >
> > I have a parser which parses to an ast which contains Text values. I
> > am trying to use this parser with quasiquoting, but the implementation
> > of Data for Text is incomplete. I've attached a smallish test case,
> > when I try to compile Text.hs I get:
> >
> > Text.hs:17:9:
> >     Exception when trying to run compile-time code:
> >       Data.Text.Text.toConstr
> >       Code: Language.Haskell.TH.Quote.quoteExp expr " test "
> >
> > Is there a way to get this working?
> >
> > Thanks,
> > Jake.
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe <at> haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
> >

Gmane