Re: [Haskell-cafe] Some useful TH templates

2009-11-23 Thread Yair Chuchem
On Mon, Nov 23, 2009 at 11:50 AM, Neil Mitchell wrote: > This looks very nice. Have you thought about putting this code in to > the Derive package? (http://community.haskell.org/~ndm/derive, and > also on Hackage). Hi Neil, If you think this would belong in Derive, then, cool, let's do it :) I'll

Re: [Haskell-cafe] Some useful TH templates

2009-11-23 Thread Neil Mitchell
Hi Yair, > I wrote some Template Haskell templates that I think may be of use to others. > > The first generates "in" and "with" functions for newtypes. This looks very nice. Have you thought about putting this code in to the Derive package? (http://community.haskell.org/~ndm/derive, and also on

[Haskell-cafe] Some useful TH templates

2009-11-19 Thread Yair Chuchem
Hi, I wrote some Template Haskell templates that I think may be of use to others. The first generates "in" and "with" functions for newtypes. For example, using it one can replace this code (from TypeCompose): > inFlip :: ((a~>b) -> (a' ~~> b')) -> (Flip (~>) b a -> Flip (~~>) b' a') > inFlip =