I did some research about Colored Petri Nets for a university assessment, and I need to implement them in Haskell. I used this document as a point of start.
When I am trying to import this module in 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)
I receive the following error:
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))
I'm still a newbie in Haskell, so a little bit of help would be appreciated.
Thanks, Denis
action
is of type marking -> [marking]
and there is no instance of typeclass Show
for functions.
You can import Text.Show.Functions
for an typeclass instance of Show
for functions, but I don't know, if it shows something useful or only "Function"
for any function.