title: Add a element at the end of list in Haskell
body: <p>i'm a beginner in Haskell and i'm trying to add an element at the end of a list.</p>
  
  <p>I enter a list like [1,2,3,4] and a number 10. I want an output like this [1,2,3,4,10].</p>
  
  <p>My code:</p>
  
  <pre><code>func a [] = a
  func a (x:xs) = x : func a (x:xs)
  </code></pre>
  
  <p>But i'm getting that error:</p>
  
  <pre><code>Non type-variable argument in the constraint: Num [a]
  (Use FlexibleContexts to permit this)
  When checking that ‘it’ has the inferred type
  it :: forall a. (Num a, Num [a]) =&gt; [a]
  </code></pre>
  
  <p>Can anyone help with a explanation ?</p>