Consider the following multi-line string S:
apple
banana berry
cantelope
I'm trying to write/locate Haskell functions which I will call in this post or-match and and-match. Here are some examples of what they should do:
or-match S ("apple","berry")
{- should return the two line string:
apple
banana berry
-}
and-match S ("apple", "berry") --should return the empty string, or something like "No matches."
and-match S ("banana" "berry") --should return a single line containing "banana berry"
In the above examples, I used the type (String, String) for the domain argument of or-match and and-match. I'm not sure that's the best way to go about it though, since I might want to use more than two arguments. I'm new to Haskell though, and am not sure how to make an tuple of arbitrary length the argument of a function.
In sum, the overall question of this post: How do I make or-match and and-match in Haskell, such that the domain argument for each of these functions is a tuple of arbitrary length (or some type that allows an arbitrary length of searches)?