1
我一直在尋找上帝知道多久,但不能得到這段代碼的工作:哈斯克爾錯誤
solution n = 3/2*((n-n`mod`3)+3)
它編譯,但是當我叫它,它拋出兩個錯誤,第一個是
No instance for (Integral a0) arising from a use of `solution'
這裏是我想要達到
solution 9 = 3/2* ((n-n`mod`3)+3) = 3/2 * ((9-0)+3) = 3/2 * (12) = 18