Why is this giving me “is a rigid type variable bound by” error
1 2 3 4 5 6 7 |
上面的代码给出了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Heist.hs:15:27: Could not deduce (n ~ Int) from the context (Num n) bound by the type signature for heist :: Num n => [n] -> [n] -> n -> n at Heist.hs:(15,1)-(17,16) `n' is a rigid type variable bound by the type signature for heist :: Num n => [n] -> [n] -> n -> n at Heist.hs:15:1 In the third argument of `func', namely `i' In the expression: func w v i j In an equation for `heist': heist w v maxw = func w v i j where i = length w j = maxw |
号
为什么会这样?
我正把我的头一寸一寸地绕在哈斯克尔式系统上。