سؤال

foo (a1,a2) (b1,b2) (c1,c2) = (bar a1 b1 c1, bar2 a2 b2 c2)

I have a lot of those constructs with different numbers of argument tuples. In the case of

foo' (a1,a2) = (bar' a1, bar2' a2)

I thought "Hey, that's arrows!":

foo' = bar' *** bar2'

But I couldn't yet figure out if and how functions with more than one input tuple (as in the first code line) map to arrow style. What is a generic way to handle such functions? Ideally, I always want something like foo = bar ... bar2.

هل كانت مفيدة؟

المحلول

let (****) = uncurry (***) in (bar1, bar2) **** (a1, a2) **** (b1, b2) **** (c1, c2)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top