解析错误在哪里。哈斯克尔

时间:2017-11-04 11:20:12

标签: haskell

我在这段代码中出错了

raices :: Double -> Double -> Double -> [Double]
raices a b c = [(-b+d)/t,(-b-d)/t]
    where d = sqrt (b^2 - 4*a*c)
          t = 2*a

这是ghci给我的错误

parse error on input ‘=’  
Perhaps you need a 'let' in a 'do' block?  
e.g. 'let x = 5' instead of 'x = 5'
   |
174|                   t = 2*a
   |                     ^

先谢谢StackOverflow程序员:D!

0 个答案:

没有答案