データ型カードのモジュールがインストールされています。私はそれをクラスShowのインスタンスにしますが、ghciで問題が発生します:
module Poker where
data Card = Card Int
...
instance Show Card where
show card = ...
...
ghciを開いて、次のように入力します。
>:m + Poker
>Card 0
..
..
..
(Nothing) => I stop the execution
>Poker.show (Card 0)
> "Ace of Hearts"
私のデータ型はクラスShowのインスタンスではないようですが、なぜですか?
皆さんありがとう!できます!:)