Haskell · 1 of 3
Types and signatures
What type does a bare whole number literal have here?
-- GHC 9.6.7, ghci :type. Literals and the arithmetic over them.1 :: Num a => a1.5 :: Fractional a => a1 + 2 :: Num a => a7 / 2 :: Fractional a => adiv 7 2 :: Integral a => atruncate 3.7 :: Integral b => bfromIntegral (3::Int) :: Num b => blength [1,2,3] :: Int