title: First element in a list haskell
body: <p>So i need to do a find2 method that take the first Element out.</p>
  
  <p>For example <code>find2 :: (a -&gt; Bool) -&gt; [a] -&gt; a</code></p>
  
  <p>and <code>find2 (&gt;4) [1 .. 10]</code></p>
  
  <p>Should have a the output <code>5</code></p>
  
  <p>I am not good with haskell, but i want to learn it.</p>
  
  <p>My first try was </p>
  
  <pre><code>find2 :: (a -&gt; Bool) -&gt; [a] -&gt; a
  find2 p [] = []
  find2 p (x:xs)
   |p x = x+1
   |otherwise = finde p xs
  </code></pre>
  
  <p>but i am getting an error</p>
  
  <pre><code> * Couldn't match expected type `a' with actual type `[a0]'
        `a' is a rigid type variable bound by
          the type signature for:
            find2 :: forall a. (a -&gt; Bool) -&gt; [a] -&gt; a
          at C:\\Users\XY\Desctop\XY.hs:30:1-32
      * In the expression: []
        In an equation for `find2': find2 p [] = []
      * Relevant bindings include
          p :: a -&gt; Bool
            (bound at C:\\Users\XY\Desctop\XY.hs:31:7)
          find2 :: (a -&gt; Bool) -&gt; [a] -&gt; a
            (bound at C:\\Users\XY\Desctop\XY.hs:31:1)
  </code></pre>