[Haskell-cafe] Non polymorphic numerals option -- avoiding type classes

Roman Cheplyaka roma at ro-che.info
Wed Dec 26 21:18:20 CET 2012


* Rustom Mody <rustompmody at gmail.com> [2012-12-26 20:12:17+0530]
> So is there any set of flags to make haskell literals less polymorphic?

Yes, there is!

  % ghci -XRebindableSyntax
  GHCi, version 7.6.1: http://www.haskell.org/ghc/  :? for help
  Loading package ghc-prim ... linking ... done.
  Loading package integer-gmp ... linking ... done.
  Loading package base ... linking ... done.
  > import Prelude hiding (fromInteger)
  Prelude> let fromInteger = id
  Prelude> :t 3
  3 :: Integer

Roman



More information about the Haskell-Cafe mailing list