Skip to content

Instantly share code, notes, and snippets.

@dagit
Created September 30, 2012 06:26
Show Gist options
  • Save dagit/3806038 to your computer and use it in GitHub Desktop.
Save dagit/3806038 to your computer and use it in GitHub Desktop.
OverloadedStrings crash
{-# 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