Re: [Haskell-cafe] Template Haskell and Types

2005-09-26 Thread Gracjan Polak
failing test cases? -- Gracjan Simon | -Original Message- | From: Gracjan Polak [mailto:[EMAIL PROTECTED] | Sent: 20 September 2005 10:43 | To: Simon Peyton-Jones | Cc: haskell-cafe@haskell.org | Subject: Re: [Haskell-cafe] Template Haskell and Types | | Simon Peyton-Jones wrote

Re: [Haskell-cafe] Template Haskell and Types

2005-09-26 Thread Duncan Coutts
On Mon, 2005-09-26 at 10:36 +0200, Gracjan Polak wrote: Simon Peyton-Jones wrote: Hmm. Q is a monad, so I think fail :: Monad m = String - m a will do the job. 'recover' should catch the exception, and let you try something else. So I think I have bug report :) Haskell-cafe

RE: [Haskell-cafe] Template Haskell and Types

2005-09-23 Thread Simon Peyton-Jones
-Jones | Cc: haskell-cafe@haskell.org | Subject: Re: [Haskell-cafe] Template Haskell and Types | | Simon Peyton-Jones wrote: | design note http://research.microsoft.com/~simonpj/tmp/notes2.ps | | | In the above paper there is something about 'giveUp'. Seems to quite | useful

Re: [Haskell-cafe] Template Haskell and Types

2005-09-20 Thread Gracjan Polak
Simon Peyton-Jones wrote: design note http://research.microsoft.com/~simonpj/tmp/notes2.ps In the above paper there is something about 'giveUp'. Seems to quite useful, but there is no such thing in ghc 6.4. Where did my giveUp go? And why? -- Gracjan

Re: [Haskell-cafe] Template Haskell and Types

2005-09-13 Thread Gracjan Polak
Tomasz Zielonka wrote: On Mon, Sep 12, 2005 at 12:08:14PM +0200, Gracjan Polak wrote: Probably very simple question about template haskell: How do I make a type for an argument to splice? Example: data MyData = MyData1 | MyData2 mysplice mytype = [| litE $ stringL $ show mytype |] main =

RE: [Haskell-cafe] Template Haskell and Types

2005-09-13 Thread Simon Peyton-Jones
| putStrLn $(mysplice ''MyData) | | | Thanks for responses. Is there any up-to-date documentation avaliable? Template Haskell is, alas, poorly documented. I would really welcome someone to volunteer to help write better documentation. Meanwhile, as the user manual says, the stuff about

Re: [Haskell-cafe] Template Haskell and Types

2005-09-13 Thread Benjamin Franksen
On Tuesday 13 September 2005 09:16, Gracjan Polak wrote: Tomasz Zielonka wrote: On Mon, Sep 12, 2005 at 12:08:14PM +0200, Gracjan Polak wrote: Probably very simple question about template haskell: How do I make a type for an argument to splice? Example: data MyData = MyData1 | MyData2

Re: [Haskell-cafe] Template Haskell and Types

2005-09-13 Thread Gracjan Polak
Simon Peyton-Jones wrote: | putStrLn $(mysplice ''MyData) | | | Thanks for responses. Is there any up-to-date documentation avaliable? Template Haskell is, alas, poorly documented. I would really welcome someone to volunteer to help write better documentation. Meanwhile, as the user

[Haskell-cafe] Template Haskell and Types

2005-09-12 Thread Gracjan Polak
Hi, Probably very simple question about template haskell: How do I make a type for an argument to splice? Example: data MyData = MyData1 | MyData2 mysplice mytype = [| litE $ stringL $ show mytype |] main = do putStrLn $(mysplice MyData) The above is not accepted, error: Compiling

Re: [Haskell-cafe] Template Haskell and Types

2005-09-12 Thread Cale Gibbard
I'm not exactly sure what it is that you're trying to do with that code, but here's an approximation to that code which prints the Template Haskell representation of the type MyData: import Language.Haskell.TH import Monad data MyData = MyData1 | MyData2 main = do putStrLn $(liftM (LitE .