Or even more general, print [] without enforcing the type?
If you turn on the ExtendedDefaultRules extension ( `{-# LANGUAGE ExtendedDefaultRules #-}` pragma or `-X ExtendedDefaultRules` ghc option), ghc will infer () for the type just as ghci does. Note that this reduces type safety a bit, since ghc will now accept programs that have what otherwise would be type errors.