| Subject: | Re: [Haskell] Swapping parameters and type classes |
|---|---|
| From: | "Brent Yorgey" |
| Date: | Sun, 16 Sep 2007 16:38:50 -0400 |
On 9/16/07, Mads Lindstrøm <mads_lindstroem@xxxxxxxx> wrote:Hi all One easy way would be to create a newtype with the type parameters swapped: newtype Oof b a = Oof (Foo a b) instance Bar (Oof b) where ... Of course, if you want to partially apply the second parameter of a function, you use 'flip'. I thought for a while about whether there's some sort of typeclass hackery which is directly parallel to the use of 'flip', but couldn't come up with anything. Anyone? -Brent _______________________________________________ Haskell mailing list Haskell@xxxxxxxxxxx http://www.haskell.org/mailman/listinfo/haskell |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [Haskell] HaL2: Meeting Haskell in Leipzig 2, videos and presentations online, Wolfgang Jeltsch |
|---|---|
| Next by Date: | Re: [Haskell] Swapping parameters and type classes, Bas van Dijk |
| Previous by Thread: | [Haskell] Swapping parameters and type classes, Mads Lindstrøm |
| Next by Thread: | Re: [Haskell] Swapping parameters and type classes, Bas van Dijk |
| Indexes: | [Date] [Thread] [Top] [All Lists] |