Question

Given:

data TwoInts = TwoInts Int Int 

add'em :: TwoInts -> Int
add'em (TwoInts a b) = a+b

is it possible to write add'em without having to name a and b. Something like:

 add'em TwoInts = (+) -- (Note: Fails to type check)

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top