我正在使用ghci
,此代码部分
newtype Gold = Gold Int
deriving (Eq, Ord, Show, Num)
将错误显示为
Can't make a derived instance of 'Num Gold':
'Num' is not a derivable class
Try GeneralizedNewTypeDeriving for GHC's newtype-deriving extension in the newtype declaration for 'Gold'
请提出解决方案。