Created
March 24, 2014 10:26
-
-
Save mxswd/9737778 to your computer and use it in GitHub Desktop.
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, FlexibleInstances #-} | |
import Data.String | |
import Unsafe.Coerce | |
import Data.Text | |
instance IsString a => IsString (a -> String) where | |
fromString s = \x -> s ++ (unsafeCoerce x) | |
-- returns "foobar" | |
cool = "foo" "bar" :: String | |
-- returns "foo" | |
wat = ("foo"::Text -> String) "bar" :: String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment