Subtle difference between standard instances

We, at Anygma, noticed that a and b below have different behavior: a, b :: (Int->Int) -> (Int,Int) -> (Int,Int) a = fmap b = second See the blog post at http://netsuperbrain.com/blog/?p=74. The standard instances for Functor, Monad, and Applicative for tuples is strict. The Arrow on (->) when applied to tuples with first and second, however is non-strict. It is a subtle discrepancy, but it does make a difference for FRP when deriving these standard instances. Any objections to making the Functor, Monad, and Applicative instances for tuples non-strict like Arrows? David

camior:
We, at Anygma, noticed that a and b below have different behavior:
a, b :: (Int->Int) -> (Int,Int) -> (Int,Int) a = fmap b = second
See the blog post at [1]http://netsuperbrain.com/blog/?p=74.
The standard instances for Functor, Monad, and Applicative for tuples is strict. The Arrow on (->) when applied to tuples with first and second, however is non-strict.
It is a subtle discrepancy, but it does make a difference for FRP when deriving these standard instances. Any objections to making the Functor, Monad, and Applicative instances for tuples non-strict like Arrows?
Changes to this kind of thing should be proposed on the libraries@ mailing list, via the submission process. http://haskell.org/haskellwiki/Library_submissions Since you guys are experts in FRP, I imagine this should be fine :) -- Don
participants (2)
-
David Sankel
-
Don Stewart