[commit: ghc] wip/T12357: FastString: Add IsString instance (bb98a13)
git at git.haskell.org
git at git.haskell.org
Tue Jul 5 10:12:15 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T12357
Link : http://ghc.haskell.org/trac/ghc/changeset/bb98a13329850eaa48f1cfb90d54ada5337062a4/ghc
>---------------------------------------------------------------
commit bb98a13329850eaa48f1cfb90d54ada5337062a4
Author: Ben Gamari <ben at smart-cactus.org>
Date: Tue Jul 5 06:06:29 2016 -0400
FastString: Add IsString instance
>---------------------------------------------------------------
bb98a13329850eaa48f1cfb90d54ada5337062a4
compiler/utils/FastString.hs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/compiler/utils/FastString.hs b/compiler/utils/FastString.hs
index 407c185..2031b16 100644
--- a/compiler/utils/FastString.hs
+++ b/compiler/utils/FastString.hs
@@ -109,6 +109,7 @@ import ExtsCompat46
import System.IO
import System.IO.Unsafe ( unsafePerformIO )
import Data.Data
+import Data.String
import Data.IORef ( IORef, newIORef, readIORef, atomicModifyIORef' )
import Data.Maybe ( isJust )
import Data.Char
@@ -197,6 +198,9 @@ instance Ord FastString where
| otherwise = y
compare a b = cmpFS a b
+instance IsString FastString where
+ fromString = fsLit
+
instance Show FastString where
show fs = show (unpackFS fs)
More information about the ghc-commits
mailing list