fromIntegralは型を変換してNum型に
Prelude> let a = 2 :: Int
Prelude> :t a
a :: Int
Prelude> :t (fromIntegral a)
(fromIntegral a) :: (Num b) => b
Num型なので、Fractionalの和も求まる
Prelude> (fromIntegral a) + 3.0
5.0
fromIntegralは型を変換してNum型に
Prelude> let a = 2 :: Int
Prelude> :t a
a :: Int
Prelude> :t (fromIntegral a)
(fromIntegral a) :: (Num b) => b
Num型なので、Fractionalの和も求まる
Prelude> (fromIntegral a) + 3.0
5.0