[Haskell-cafe] Ignorant begginer question

Maurício briqueabraque at yahoo.com
Thu Dec 23 12:09:59 EST 2004


   What is wrong with this code?

import Complex
roots :: (Complex, Complex, Complex) -> (Complex, Complex);
roots (a,b,c) = (x1,x2) where { x1 = (b*b + (sqrt_delta))/(2*a); x2 = 
(b*b - (sqrt_delta))/(2*a); sqrt_delta = sqrt 4*a*c}

   I load it into GHCi and get:

Kind error: `Complex' is not applied to enough type arguments
In the type: (Complex, Complex, Complex) -> (Complex, Complex)
While checking the type signature for `roots'
Failed, modules loaded: none.


More information about the Haskell-Cafe mailing list