Guest User

Untitled

a guest
Dec 11th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. {-# LANGUAGE NoImplicitPrelude #-}
  2. {-# LANGUAGE RebindableSyntax #-}
  3.  
  4. import Prelude hiding (fromInteger)
  5.  
  6. -- In the Haskell report specification,
  7. -- a literal `1` is expanded to `Prelude.fromInteger (1 :: Integer)`.
  8. --
  9. -- RebindableSyntax changes it to that is expanded to `fromInteger (1 :: Integer)`,
  10. -- also it means `1`'s convertion is able to rebind.
  11. fromInteger :: Integer -> String
  12. fromInteger _ = ";P"
  13.  
  14. main :: IO ()
  15. main = putStrLn 1
Add Comment
Please, Sign In to add comment