我做了一些關於有色Petri網的大學評估研究,我需要在Haskell中實現它們。我使用this文件作爲開始。Haskell派生顯示錯誤
當我試圖導入此模塊中哈斯克爾:
module SimpleHCPN where
import Data.List
import System.Random
data Net marking = Net {trans :: [Transition marking]}
deriving (Show)
data Transition marking = Transition { name :: String
, action :: marking -> [marking]
}
deriving (Show)
我收到以下錯誤:
SimpleHCPN.hs:11:37: error:
* No instance for (Show (marking -> [marking]))
arising from the second field of `Transition'
(type `marking -> [marking]')
(maybe you haven't applied a function to enough arguments?)
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
* When deriving the instance for (Show (Transition marking))
我仍然在Haskell一個新手,幫助那麼一點點將不勝感激。
謝謝, 丹尼斯
更多相關問題:[1](https://stackoverflow.com/q/15823732/791604),[2](https://stackoverflow.com/q/15015698/791604),[3](https ://stackoverflow.com/q/10551210/791604)。 –