Haskell's division operator (/) does not do floating point conversion. It may seem that way to you since evaluating 3/4 gives 0.75, for example. What actually happens is that every integer literal get the function fromInteger applied to it automatically, this function converts integers to whatever other type is necessary. So if you evaluate 3/4 at the REPL you're really computing (fromInteger 3) / (fromInteger 4), giving, by default[^1] a floating point number.
The key point in this is that only integer literals get fromInteger applied automatically, so for example
let n=6 :: Integer in n/3
gives a type error since n is not a literal and thus not automatically coerced. (Of course, doing this without the type declaration,
let n=6 in n/3
does give 2.0 as result, but it declares n to be a Fractional number, not an Integer.)
[^1]: only by default, if you load the rational number library, you can ask for / to compute rational numbers by simply saying the type of result you want: 3/4 :: Ratio Int evaluates to the rational number 3 % 4 (% is Haskell's odd choice of notation for rationals).
The key point in this is that only integer literals get fromInteger applied automatically, so for example
gives a type error since n is not a literal and thus not automatically coerced. (Of course, doing this without the type declaration, does give 2.0 as result, but it declares n to be a Fractional number, not an Integer.)[^1]: only by default, if you load the rational number library, you can ask for / to compute rational numbers by simply saying the type of result you want: 3/4 :: Ratio Int evaluates to the rational number 3 % 4 (% is Haskell's odd choice of notation for rationals).