Permalink
Browse files

Provide IsString instance for YamlScalar

  • Loading branch information...
1 parent 9a0f1dd commit bbeefe52668518c143aafdd86a3121276a5a4105 @jaspervdj jaspervdj committed Mar 14, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 Data/Object/Yaml.hs
View
@@ -152,6 +152,7 @@ import qualified Data.Enumerator as E
import Data.Enumerator (($$))
import Prelude hiding (catch)
import Control.Exception (throwIO, Exception)
+import GHC.Exts (IsString (fromString))
-- | Equality depends on 'value' and 'tag', not 'style'.
data YamlScalar = YamlScalar
@@ -162,6 +163,8 @@ data YamlScalar = YamlScalar
deriving (Show, Read, Data, Typeable)
instance Eq YamlScalar where
(YamlScalar v t _) == (YamlScalar v' t' _) = v == v' && t == t'
+instance IsString YamlScalar where
+ fromString = toYamlScalar
type YamlObject = Object YamlScalar YamlScalar

0 comments on commit bbeefe5

Please sign in to comment.