1
:はなぜリストを返す機能をHaskellのことができないと間違っている何
partin a = [floor a, a-floor a]
エラー:
<interactive>:342:1: error:
• Ambiguous type variable ‘a0’ arising from a use of ‘print’
prevents the constraint ‘(Show a0)’ from being solved.
Probable fix: use a type annotation to specify what ‘a0’ should be.
These potential instances exist:
instance Show Ordering -- Defined in ‘GHC.Show’
instance Show Integer -- Defined in ‘GHC.Show’
instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’
...plus 22 others
...plus 16 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In a stmt of an interactive GHCi command: print it
これは、何かを印刷することを話していますが、何かを印刷しようとしているかはわかりません。あなたがやっていることの残りの部分を示してください。 – dfeuer
実際に私が "part a = a - floor a"をするときにも同じエラーが出ます。コードはこの機能でのみ構成されています –
GHCiプロンプトで、「対話型GHCiコマンドのstmt: 'print it'」のように、「part something」とタイプしました。 – HTNW