1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 16:33:03 +03:00

Write a custom Show instance for JSString.

This commit is contained in:
Rob Rix 2016-02-29 17:30:39 -05:00
parent 47c71a0acf
commit 466d7d3611

View File

@ -10,7 +10,10 @@ data JSValue
deriving (Eq, Show)
newtype JSString = JSONString { fromJSString :: String }
deriving (Eq, Show)
deriving (Eq)
instance Show JSString where
show (JSONString s) = "\"" ++ s ++ "\""
toJSString :: String -> JSString
toJSString = JSONString