
On Sat, Nov 21, 2009 at 10:13 PM, John Dorsey
Chaddaï Fouché wrote:
second :: (b -> c) -> (d, b) -> (d, c) which corresponds exactly to the action of second you described (that's the only function that could have this type, except bottom of course).
Nonsense! There are several perfectly good Haskell functions with that type. I count seven:
second :: (b -> c) -> (d, b) -> (d, c) second = Control.Arrow.second second = undefined second = const undefined second = const (const undefined) second = const (const (undefined,undefined)) second f (d,b) = (undefined, f b) second f (d,b) = (d, undefined)
Right... Let's just say functions that may be evaluated to normal form if their parameters can be evaluated to normal form. Nitpicker !! :P -- Jedaï