
28 Oct
2018
28 Oct
'18
9:48 a.m.
According to GHCi, λ:> import Control.Arrow λ:> :t (id &&& id) (id &&& id) :: b -> (b, b) That is, this implementation has type a -> (a, a) as well. On 10/28/18 6:52 AM, Ivan Perez wrote:
On 28/10/18 03:51, Dannyu NDos wrote:
If this is for convenience for arrows, isn't it better implemented as?:
dup :: Arrow a => a b (b,b) dup = id &&& id
Hi
Performance aside, I'd say your suggestion is better than using a pure function. It's clearer about what it does, and it works for functions as well (since they are arrows).
Ivan
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries