gdritter repos activitystreams-aeson / 742d34d
Adds `asObject` function. The spec says that an Activity may be used as on Object. This adds a function that just does a type cast to support that. Jesse Hallett 9 years ago
1 changed file(s) with 7 addition(s) and 0 deletion(s). Collapse all Expand all
5757 , acVerb
5858 , acRest
5959 , makeActivity
60 , asObject
6061 -- * Collection
6162 , Collection
6263 , cTotalItems
231232 $ HM.insert "published" (toJSON published)
232233 $ HM.empty
233234
235 -- | JSON Activity Streams 1.0 specificies that an @Activity@ may be used as an
236 -- @Object@. In such a case, the object may have fields permitted on either an
237 -- @Activity@ or an @Object@
238 asObject :: Activity -> Object
239 asObject act = Object (fromActivity act)
240
234241 -- | Collection
235242
236243 data Collection = Collection { fromCollection :: A.Object } deriving (Eq, Show)