
15 Jul
2010
15 Jul
'10
9:50 p.m.
begin Vo Minh Thu quotation:
I guess it is short because you make use of second... so you can define second' for your B data type, or make B an instance of Arrow.
I don't think that's the case. The code for "f" is making use of the Arrow instance for (->): second :: Arrow a => a b c -> a (d, b) (d, c) (str ++) :: [Char] -> [Char] second (str ++) :: (d, [Char]) -> (d, [Char]) All the caller can control here is what sort of "d" is passed through unchanged, not the fact that the resulting function expects a pair and returns a pair. -md