関数 fromIntegral を使用したときの GHCi での次の動作について、誰かが説明してくれることを期待していました。
Prelude> let x = 1 :: Integer
Prelude> :t x
x :: Integer
Prelude> sqrt $ fromIntegral x
1.0
Prelude> let y = fromIntegral x
Prelude> sqrt y
<interactive>:181:1:
No instance for (Floating Integer)
arising from a use of `sqrt'
Possible fix: add an instance declaration for (Floating Integer)
In the expression: sqrt y
In an equation for `it': it = sqrt y
y
設定してから取得するsqrt
か、直接取得するかが問題になるのはなぜsqrt
ですか?