我有以下定义
data AST
= Number Integer
| Identifier String
| String String
-- | Operation BinOp AST AST
| Query String
deriving (Show, Eq)
data Tuple = Tuple {cmd :: String,
cid :: AST,
argumentList :: [AST],
queryList :: [AST]} deriving (Show, Eq)
当我尝试打印例如 cid 时,我得到了错误
No instance for (Show (Tuple -> AST)) arising from a use of `print'
这让我很惊讶,因为 AST 和 Tuple 都是 show 类的成员。如何使 cid、argumentList 和 queryList 可打印?