Created
September 30, 2012 06:26
-
-
Save dagit/3806038 to your computer and use it in GitHub Desktop.
OverloadedStrings crash
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
{-# LANGUAGE OverloadedStrings #-} | |
import Data.String | |
newtype BadString = BS String deriving Show | |
instance IsString BadString where fromString = error | |
main = print ("Hello, World!" :: BadString) | |
{- | |
produces: | |
$ ./Overloaded.exe | |
Overloaded.exe: Hello, World! | |
Instead of: | |
$ ./Overloaded.exe | |
BS "Hello, World!" | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment