первый.

я есть это определение типа:

data Operace = Op (Int->Int->Int) String (Int->Int->Int) deriving Show

Я хочу напечатать этот тип в интерактивную оболочку (GHCi). Все, что должно быть напечатано, этоString поле.

Я попробовал это:

instance Show Operace where
    show (Op op str inv) = show str

Но я все еще продолжаю получать

No instance for (Show (Int -> Int -> Int))
  arising from the 'deriving' clause of a data type declaration
Possible fix:
  add an instance declaration for (Show (Int -> Int -> Int))
  or use a standalone 'deriving instance' declaration,
       so you can specify the instance context yourself
When deriving the instance for (Show Operace)

Я не хочу добавлятьShow за(Int->Int->Int)все, что я хочу напечатать, это строка.

Спасибо за помощь!

РЕДАКТИРОВАТЬ:

Для дальнейшего использования исправлена ​​версия:

data Operace = Op (Int->Int->Int) String (Int->Int->Int)

instance Show Operace where
    show (Op op str inv) = str

Ответы на вопрос(2)

Ваш ответ на вопрос