Add instances for generating JSON
This commit is contained in:
parent
26a8c82b6f
commit
a3cb09a0c1
2 changed files with 7 additions and 0 deletions
|
@ -41,6 +41,9 @@ instance FromJSON Name where
|
|||
|
||||
parseJSON _ = fail "Project name must be a string."
|
||||
|
||||
instance ToJSON Name where
|
||||
toJSON name = toJSON (show name)
|
||||
|
||||
errorMsg string =
|
||||
unlines
|
||||
[ "Dependency file has an invalid name: " ++ string
|
||||
|
|
|
@ -67,3 +67,7 @@ instance FromJSON Version where
|
|||
]
|
||||
|
||||
parseJSON _ = fail "Version number must be stored as a string."
|
||||
|
||||
instance ToJSON Version where
|
||||
toJSON version = toJSON (show version)
|
||||
|
||||
|
|
Loading…
Reference in a new issue