Re: [Haskell-cafe] Help me TH code.

2010-10-27 Thread Serguey Zefirov
2010/10/27 Andy Stewart : > Serguey Zefirov writes: >> I think that you should use TH properly, without compiler and logical errors. >> >> What actually do you want? > I'm build multi-processes communication program. You don't need TH here, I think. You can write a class Ask: class Ask a where

Re: [Haskell-cafe] Help me TH code.

2010-10-27 Thread Jonas Almström Duregård
Unless you have a 'real' type for parse sometime during compile time, TH won't be able to generate it. A good rule of thumbs is that if you can't write the code yourself, then you can't get TH to do it either. /J On 27 October 2010 08:50, Andy Stewart wrote: > Serguey Zefirov writes: > > > 201

Re: [Haskell-cafe] Help me TH code.

2010-10-26 Thread Andy Stewart
Serguey Zefirov writes: > 2010/10/27 Andy Stewart : >> Hi all, >> >> I want use TH write some function like below: >> >>  data DataType = StringT >>                | IntT >>                | CharT >> >>  parse :: [(String,DataType)] -> (TypeA, TypeB, ... TypeN) >> >> Example: >> >>  parse [("stri

Re: [Haskell-cafe] Help me TH code.

2010-10-26 Thread Serguey Zefirov
2010/10/27 Andy Stewart : > Hi all, > > I want use TH write some function like below: > >  data DataType = StringT >                | IntT >                | CharT > >  parse :: [(String,DataType)] -> (TypeA, TypeB, ... TypeN) > > Example: > >  parse [("string", StringT), ("001", IntT), ("c", CharT

[Haskell-cafe] Help me TH code.

2010-10-26 Thread Andy Stewart
Hi all, I want use TH write some function like below: data DataType = StringT | IntT | CharT parse :: [(String,DataType)] -> (TypeA, TypeB, ... TypeN) Example: parse [("string", StringT), ("001", IntT), ("c", CharT)] will return: ("string", 001, 'c')