There is a function

rtct::String->Bool->[(String,Bool)]->Bool rtct ab xd= foldr (\(q,yn) c -> c||((a==q)&&(b/=yn))) (False) xd 

The foldr convolution takes a binary function, an initial value and a list, and here the binary function has a tuple argument and how to understand it?

    1 answer 1

    The question is not clear. The rtct parameter and, accordingly, foldr is a list of tuples, and a binary function has a tuple (from this list). Your function can be rewritten as

     rtct ab xd = any (\(q, yn) -> a == q && b /= yn) xd 

    Or, removing xd

     rtct ab = any (\(q, yn) -> a == q && b /= yn) 

    Try to reformulate the question.

    upd Let's try this: function type foldr:

     foldr :: (a -> b -> b) -> b -> [a] -> b 

    In your case, the parameter of type a denotes the type (String, Bool), and the parameter of type b is the type Bool (respectively, by type everything is fine). The function used in foldr is applied to the elements of the list (the list is [(String, Bool)], the element is (String, Bool)) and to the battery of the Bool type.