我在hMatrix上使用函數fromBlocks
,其列表的元素由Int -> Int -> Int -> Matrix Int
類型的函數確定。然而,GHC笙歌說:Haskell - hMatrix上的實例聲明
No instance for (Element Int) arising from a use of `fromBlocks'
Possible fix: add an instance declaration for (Element Int)
In the expression:
fromBlocks [[matrixCreate n m d], [rowZero n m d]]
我試圖告訴GHC這種計算與:: Matrix Int
結果的類型,但它沒有工作,我不知道如何申報類型,使用時功能。
大,謝謝! – guaraqe
Alberto(包裝作者)贊同vivian這個答案是不正確的。 – vivian
然後,也許給一個提示什麼是錯的,我們可以修復它 - 哦等待你只是想推你自己的答案... – Carsten