module Mpv.Data.Volume where

import Polysemy.Time.Json (json)

newtype Volume =
  Volume { Volume -> Double
unVolume :: Double }
  deriving stock (Volume -> Volume -> Bool
(Volume -> Volume -> Bool)
-> (Volume -> Volume -> Bool) -> Eq Volume
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Volume -> Volume -> Bool
$c/= :: Volume -> Volume -> Bool
== :: Volume -> Volume -> Bool
$c== :: Volume -> Volume -> Bool
Eq, Int -> Volume -> ShowS
[Volume] -> ShowS
Volume -> String
(Int -> Volume -> ShowS)
-> (Volume -> String) -> ([Volume] -> ShowS) -> Show Volume
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Volume] -> ShowS
$cshowList :: [Volume] -> ShowS
show :: Volume -> String
$cshow :: Volume -> String
showsPrec :: Int -> Volume -> ShowS
$cshowsPrec :: Int -> Volume -> ShowS
Show, (forall x. Volume -> Rep Volume x)
-> (forall x. Rep Volume x -> Volume) -> Generic Volume
forall x. Rep Volume x -> Volume
forall x. Volume -> Rep Volume x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Volume x -> Volume
$cfrom :: forall x. Volume -> Rep Volume x
Generic)
  deriving newtype (Integer -> Volume
Volume -> Volume
Volume -> Volume -> Volume
(Volume -> Volume -> Volume)
-> (Volume -> Volume -> Volume)
-> (Volume -> Volume -> Volume)
-> (Volume -> Volume)
-> (Volume -> Volume)
-> (Volume -> Volume)
-> (Integer -> Volume)
-> Num Volume
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> Volume
$cfromInteger :: Integer -> Volume
signum :: Volume -> Volume
$csignum :: Volume -> Volume
abs :: Volume -> Volume
$cabs :: Volume -> Volume
negate :: Volume -> Volume
$cnegate :: Volume -> Volume
* :: Volume -> Volume -> Volume
$c* :: Volume -> Volume -> Volume
- :: Volume -> Volume -> Volume
$c- :: Volume -> Volume -> Volume
+ :: Volume -> Volume -> Volume
$c+ :: Volume -> Volume -> Volume
Num, Eq Volume
Eq Volume
-> (Volume -> Volume -> Ordering)
-> (Volume -> Volume -> Bool)
-> (Volume -> Volume -> Bool)
-> (Volume -> Volume -> Bool)
-> (Volume -> Volume -> Bool)
-> (Volume -> Volume -> Volume)
-> (Volume -> Volume -> Volume)
-> Ord Volume
Volume -> Volume -> Bool
Volume -> Volume -> Ordering
Volume -> Volume -> Volume
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Volume -> Volume -> Volume
$cmin :: Volume -> Volume -> Volume
max :: Volume -> Volume -> Volume
$cmax :: Volume -> Volume -> Volume
>= :: Volume -> Volume -> Bool
$c>= :: Volume -> Volume -> Bool
> :: Volume -> Volume -> Bool
$c> :: Volume -> Volume -> Bool
<= :: Volume -> Volume -> Bool
$c<= :: Volume -> Volume -> Bool
< :: Volume -> Volume -> Bool
$c< :: Volume -> Volume -> Bool
compare :: Volume -> Volume -> Ordering
$ccompare :: Volume -> Volume -> Ordering
Ord, Int -> Volume
Volume -> Int
Volume -> [Volume]
Volume -> Volume
Volume -> Volume -> [Volume]
Volume -> Volume -> Volume -> [Volume]
(Volume -> Volume)
-> (Volume -> Volume)
-> (Int -> Volume)
-> (Volume -> Int)
-> (Volume -> [Volume])
-> (Volume -> Volume -> [Volume])
-> (Volume -> Volume -> [Volume])
-> (Volume -> Volume -> Volume -> [Volume])
-> Enum Volume
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: Volume -> Volume -> Volume -> [Volume]
$cenumFromThenTo :: Volume -> Volume -> Volume -> [Volume]
enumFromTo :: Volume -> Volume -> [Volume]
$cenumFromTo :: Volume -> Volume -> [Volume]
enumFromThen :: Volume -> Volume -> [Volume]
$cenumFromThen :: Volume -> Volume -> [Volume]
enumFrom :: Volume -> [Volume]
$cenumFrom :: Volume -> [Volume]
fromEnum :: Volume -> Int
$cfromEnum :: Volume -> Int
toEnum :: Int -> Volume
$ctoEnum :: Int -> Volume
pred :: Volume -> Volume
$cpred :: Volume -> Volume
succ :: Volume -> Volume
$csucc :: Volume -> Volume
Enum, Num Volume
Ord Volume
Num Volume -> Ord Volume -> (Volume -> Rational) -> Real Volume
Volume -> Rational
forall a. Num a -> Ord a -> (a -> Rational) -> Real a
toRational :: Volume -> Rational
$ctoRational :: Volume -> Rational
Real, Num Volume
Num Volume
-> (Volume -> Volume -> Volume)
-> (Volume -> Volume)
-> (Rational -> Volume)
-> Fractional Volume
Rational -> Volume
Volume -> Volume
Volume -> Volume -> Volume
forall a.
Num a
-> (a -> a -> a) -> (a -> a) -> (Rational -> a) -> Fractional a
fromRational :: Rational -> Volume
$cfromRational :: Rational -> Volume
recip :: Volume -> Volume
$crecip :: Volume -> Volume
/ :: Volume -> Volume -> Volume
$c/ :: Volume -> Volume -> Volume
Fractional)

json ''Volume