Haskell 导出显示错误

Haskell deriving Show error

我为大学评估做了一些关于彩色 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 中还是个新手,所以能提供一点帮助将不胜感激。

谢谢, 丹尼斯

actionmarking -> [marking] 类型,函数没有类型类 Show 的实例。

您可以为函数的 Show 的类型类实例导入 Text.Show.Functions,但我不知道它是否显示有用的东西或仅对任何函数显示 "Function"