Re: [Haskell-cafe] Type classes and hFoldr from HList

2005-11-07 Thread Greg Buchholz
Ralf Lammel wrote: What you can do is define a dedicated *type code* for composition. comp = hFoldr (undefined::Comp) (id::Int - Int) test data Comp instance Apply Comp (x - y,y - z) (x - z) where apply _ (f,g) = g . f That does it! Thanks, Greg Buchholz

[Haskell-cafe] Type classes and hFoldr from HList

2005-11-06 Thread Greg Buchholz
I was playing around with the HList library from the paper... Strongly typed heterogeneous collections http://homepages.cwi.nl/~ralf/HList/ ...and I thought I'd try to fold the composition function (.) through a heterogeneous list of functions, using hFoldr... {-# OPTIONS

RE: [Haskell-cafe] Type classes and hFoldr from HList

2005-11-06 Thread Ralf Lammel
-Original Message- From: [EMAIL PROTECTED] [mailto:haskell-cafe- [EMAIL PROTECTED] On Behalf Of Greg Buchholz Sent: Sunday, November 06, 2005 7:01 PM To: haskell-cafe@haskell.org Subject: [Haskell-cafe] Type classes and hFoldr from HList I was playing around with the HList library from