title: How to handle nested conditionals
body: <p>I'm writing a function where I would like to return True if a number of conditions are met. For example, consider this function which compares two strings:</p>
  
  <pre><code>test st1 st2
      | st1 == st2
          | "foo" `isInfixOf` st1 = True
          | "baz" `isInfixOf` st2 = True
          | otherwise = False
      | otherwise = False
  </code></pre>
  
  <p>Obviously, this function is incorrect. However, I'm looking for a way to test several conditions and I wanted to know:</p>
  
  <p>A) what is the clearest way to do this?
  B) is there an approach similar to what i have generated that uses guards?</p>
  
  <p>For clarity, in my simple example above, the output of <code>test</code> should be the following:</p>
  
  <pre><code>test "foobuz" "foobuz" = True
  test "foobutter" "foobuz" = False
  test "buz" "buz" = False
  </code></pre>
  
  <p>N.B. Chaining conditions together might be an option, but it gets very unreadable after only two or three tests:</p>
  
  <pre><code>test st1 st2 = st1 == st2 &amp;&amp; "foo" `isInfixOf` s1 || "baz" `isInfixOf` s2
  </code></pre>
  
  <p>I was thinking there might be a way to use the Endo Monoid to test a chain of several conditionals?</p>