Hi! > [...]
> > twin :: a -> (a,a) > > twin x = (x,x) By using the Monad instance of ((->) a), defined in Control.Monad.Reader, one can write join (,) for twin. (And, by the way, one can use join for functions in several other useful ways. For example, one can write join (*) for a squaring function. Here one can see how practical it is to implement rather abstract concepts like monads via classes and define appropriate instances of the respective classes.) > > applyFst :: (a -> b) -> (a, c) -> (b, c) > > applyFst f = applyPair (f . fst, snd) > > > > applySnd :: (a -> b) -> (c, a) -> (c, b) > > applySnd f = applyPair (fst, f . snd) These two can be written as first and second by using the Arrow instance of (->). I suppose that other functions you defined can be easily defined/replaced by arrow expressions as well. > [...] Wolfgang _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell