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:
parent
72f96a0dff
commit
ad3a20d783
11 changed files with 360 additions and 27 deletions
src/Data/Aeson
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue