The default rules of GHCi say that the selected type is () . which is the default type that is selected if a Show instance is required. GHCi will select () for general constraints, Integer for numerical or integral constraints, and Double for fractional / other real constraints. This is not due to the fact that some kind of Haskell is internal; this is exactly how GHCi was implemented so that it can be easily used as a calculator.
If you really entered the code into a file and compiled it, the stricter GHC rules would apply and you would get an error stating that the intermediate type cannot be resolved.
Of course, you can instruct the GHC to use a different type by specifying one of the functions of the type, for example:
show . (read :: String -> Int)
source share