packages feed

pushbullet-types 0.4.0.2 → 0.4.1.0

raw patch · 2 files changed

+22/−5 lines, 2 files

Files

pushbullet-types.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                pushbullet-types-version:             0.4.0.2+version:             0.4.1.0 synopsis:            Datatypes used by the Pushbullet APIs -- description: license:             MIT
src/Network/Pushbullet/Types/Misc.hs view
@@ -1,4 +1,17 @@-module Network.Pushbullet.Types.Misc where+module Network.Pushbullet.Types.Misc+( EmailAddress(..),+  ChannelTag(..),+  ChannelId(..),+  ClientId(..),+  MimeType(..),+  Url(..),+  Guid(..),+  PhoneNumber(..),+  TrivialObject,+  trivialObject,+  Name(..)+)+where  import Data.Aeson import qualified Data.HashMap.Lazy as H@@ -29,8 +42,12 @@   deriving (Eq, FromJSON, Show, ToJSON)  newtype TrivialObject = TrivialObject ()-  deriving (Eq, Ord, Monoid, Show)+  deriving (Eq, Ord, Show) +-- | Constructs a trivial object, with no keys.+trivialObject :: TrivialObject+trivialObject = TrivialObject ()+ newtype Name = Name   { unName :: Text   }@@ -41,6 +58,6 @@  instance FromJSON TrivialObject where   parseJSON (Object o)-    | H.null o = pure mempty-    | otherwise = fail "trivial object has no keys"+    | H.null o = pure trivialObject+    | otherwise = fail "cannot parse non-trivial object to trivial object"   parseJSON _ = fail "cannot parse non-object to trivial object"