Re: [Haskell-cafe] (twice head) (twice tail)

2006-11-12 Thread Claus Reinke
not a solution to your problem, but covers all your tests, as well as one more that would inevitably have followed:-) cheers, claus Twice.hs Description: Binary data ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] (twice head) (twice tail)

2006-11-11 Thread Greg Buchholz
Over on comp.lang.functional ( http://xrl.us/s6kv ), Toby Kelsey is wondering about writing a function twice that applies a function to an argument two times... twice' :: (a - a) - a - a twice' f x = f (f x) ...that works for things like twice succ 0 and twice tail [1,2,3], but the type