
21 Nov
2009
21 Nov
'09
4:13 p.m.
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) Why I'm stickling on that point on the beginners list, however, is a mystery. I'll go write a more useful response, in contrition. John