Created
February 16, 2018 07:17
-
-
Save ammaraskar/f2de65f3f2cb0c003b5a36f4018375e9 to your computer and use it in GitHub Desktop.
Demonstration of Haskell's type defaulting converting Num -> Integer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
λ ghci -Wtype-defaults | |
GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help | |
Prelude> :t 23 | |
23 :: Num p => p | |
Prelude> quot 23 2 | |
<interactive>:2:1: warning: [-Wtype-defaults] | |
* Defaulting the following constraints to type `Integer' | |
(Show a0) arising from a use of `print' at <interactive>:2:1-9 | |
(Integral a0) arising from a use of `it' at <interactive>:2:1-9 | |
* In a stmt of an interactive GHCi command: print it | |
11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment