Browse Source

Add Ord instances for TV, Season, and Episode

tags/v0.2.2.0
Peter J. Jones 4 years ago
parent
commit
99b6f95576

+ 5
- 0
src/Network/API/TheMovieDB/Types/Episode.hs View File

@@ -58,6 +58,11 @@ data Episode = Episode

} deriving (Eq, Show)

--------------------------------------------------------------------------------
instance Ord Episode where
compare a b = compare (episodeSeasonNumber a, episodeNumber a)
(episodeSeasonNumber b, episodeNumber b)

--------------------------------------------------------------------------------
instance FromJSON Episode where
parseJSON (Object v) =

+ 4
- 0
src/Network/API/TheMovieDB/Types/Season.hs View File

@@ -56,6 +56,10 @@ data Season = Season

} deriving (Eq, Show)

--------------------------------------------------------------------------------
instance Ord Season where
compare a b = seasonNumber a `compare` seasonNumber b

--------------------------------------------------------------------------------
instance FromJSON Season where
parseJSON (Object v) =

+ 4
- 0
src/Network/API/TheMovieDB/Types/TV.hs View File

@@ -77,6 +77,10 @@ data TV = TV

} deriving (Eq, Show)

--------------------------------------------------------------------------------
instance Ord TV where
compare a b = tvID a `compare` tvID b

--------------------------------------------------------------------------------
instance FromJSON TV where
parseJSON (Object v) =

Loading…
Cancel
Save