1
0
Fork 0
mirror of https://code.naskya.net/repos/ndqEd synced 2025-03-20 15:14:54 +09:00

Receive remote comments on local ticket discussion

This commit is contained in:
fr33domlover 2019-03-21 22:57:15 +00:00
parent 72f96a0dff
commit ad3a20d783
11 changed files with 360 additions and 27 deletions
src/Data/Aeson

View file

@ -19,6 +19,7 @@ module Data.Aeson.Local
, fromEither
, frg
, (.=?)
, WithValue (..)
)
where
@ -57,3 +58,11 @@ infixr 8 .=?
(.=?) :: ToJSON v => Text -> Maybe v -> Series
_ .=? Nothing = mempty
k .=? (Just v) = k .= v
data WithValue a = WithValue
{ wvRaw :: Value
, wvParsed :: a
}
instance FromJSON a => FromJSON (WithValue a) where
parseJSON v = WithValue v <$> parseJSON v