title: Fail to prrint out the error message in haskell
body: <p>I have following circular convolution implemented. I would like to restrict the length of first input must be no longer than the second input. If inputs violate the rule, I would like to print an error message.</p>
  
  <pre><code>roll :: (Num a) =&gt; [a] -&gt; [a] -&gt; [a]
  roll _ [] = []
  roll [] _ = []
  roll h x = sample : roll h (tail x) 
       where sample = sum $ zipWith (*) h x 
  
  circConv :: (Num a) =&gt; [a] -&gt; [a] -&gt; [a]
  circConv h x
           | lenx &gt;= lenh = take lenx $ roll (reverse h) $ drop (lenx - lenh `div` 2) $ cycle x
           | otherwise  = error "length of first input should be no great than that of the second one"
             where lenx = length x
                   lenh = length h
  </code></pre>
  
  <p>After I run it, I got following output from GHCi</p>
  
  <pre><code>ghci&gt; circConv [1,2,3,4,5,6] [1 1]
  
  &lt;interactive&gt;:61:1:
      No instance for (Num a0) arising from a use of `circConv'
      The type variable `a0' is ambiguous
      Possible fix: add a type signature that fixes these type variable(s)
      Note: there are several potential instances:
        instance Num Double -- Defined in `GHC.Float'
        instance Num Float -- Defined in `GHC.Float'
        instance Integral a =&gt; Num (GHC.Real.Ratio a)
          -- Defined in `GHC.Real'
        ...plus three others
      In the expression: circConv [1, 2, 3, 4, ....] [1 1]
      In an equation for `it': it = circConv [1, 2, 3, ....] [1 1]
  
  &lt;interactive&gt;:61:25:
      No instance for (Num (a1 -&gt; a0)) arising from the literal `1'
      Possible fix: add an instance declaration for (Num (a1 -&gt; a0))
      In the expression: 1
      In the expression: 1 1
      In the second argument of `circConv', namely `[1 1]'
  
  &lt;interactive&gt;:61:27:
      No instance for (Num a1) arising from the literal `1'
      The type variable `a1' is ambiguous
      Possible fix: add a type signature that fixes these type variable(s)
      Note: there are several potential instances:
        instance Num Double -- Defined in `GHC.Float'
        instance Num Float -- Defined in `GHC.Float'
        instance Integral a =&gt; Num (GHC.Real.Ratio a)
          -- Defined in `GHC.Real'
        ...plus three others
      In the first argument of `1', namely `1'
      In the expression: 1 1
      In the second argument of `circConv', namely `[1 1]'
  </code></pre>
  
  <p>PS: I know there are other way to deal with exceptions/errors in Haskell. As a beginner, I am not there yet.</p>
  
  <p>Thanks</p>