module Data.Time.Calendar.Private where import Data.Fixed data PadOption = Pad Int Char | NoPad showPadded :: PadOption -> String -> String showPadded :: PadOption -> String -> String showPadded PadOption NoPad String s = String s showPadded (Pad Int i Char c) String s = Int -> Char -> String forall a. Int -> a -> [a] replicate (Int i Int -> Int -> Int forall a. Num a => a -> a -> a External instance of the constraint type Num Int - String -> Int forall (t :: * -> *) a. Foldable t => t a -> Int External instance of the constraint type Foldable [] length String s) Char c String -> String -> String forall a. [a] -> [a] -> [a] ++ String s class (Num t,Ord t,Show t) => ShowPadded t where showPaddedNum :: PadOption -> t -> String instance ShowPadded Integer where showPaddedNum :: PadOption -> Integer -> String showPaddedNum PadOption NoPad Integer i = Integer -> String forall a. Show a => a -> String External instance of the constraint type Show Integer show Integer i showPaddedNum PadOption pad Integer i | Integer i Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool External instance of the constraint type Ord Integer < Integer 0 = Char '-'Char -> String -> String forall a. a -> [a] -> [a] :(PadOption -> Integer -> String forall t. ShowPadded t => PadOption -> t -> String Instance of class: ShowPadded of the constraint type ShowPadded Integer showPaddedNum PadOption pad (Integer -> Integer forall a. Num a => a -> a External instance of the constraint type Num Integer negate Integer i)) showPaddedNum PadOption pad Integer i = PadOption -> String -> String showPadded PadOption pad (String -> String) -> String -> String forall a b. (a -> b) -> a -> b $ Integer -> String forall a. Show a => a -> String External instance of the constraint type Show Integer show Integer i instance ShowPadded Int where showPaddedNum :: PadOption -> Int -> String showPaddedNum PadOption NoPad Int i = Int -> String forall a. Show a => a -> String External instance of the constraint type Show Int show Int i showPaddedNum PadOption _pad Int i | Int i Int -> Int -> Bool forall a. Eq a => a -> a -> Bool External instance of the constraint type Eq Int == Int forall a. Bounded a => a External instance of the constraint type Bounded Int minBound = Int -> String forall a. Show a => a -> String External instance of the constraint type Show Int show Int i showPaddedNum PadOption pad Int i | Int i Int -> Int -> Bool forall a. Ord a => a -> a -> Bool External instance of the constraint type Ord Int < Int 0 = Char '-'Char -> String -> String forall a. a -> [a] -> [a] :(PadOption -> Int -> String forall t. ShowPadded t => PadOption -> t -> String Instance of class: ShowPadded of the constraint type ShowPadded Int showPaddedNum PadOption pad (Int -> Int forall a. Num a => a -> a External instance of the constraint type Num Int negate Int i)) showPaddedNum PadOption pad Int i = PadOption -> String -> String showPadded PadOption pad (String -> String) -> String -> String forall a b. (a -> b) -> a -> b $ Int -> String forall a. Show a => a -> String External instance of the constraint type Show Int show Int i show2Fixed :: Pico -> String show2Fixed :: Pico -> String show2Fixed Pico x | Pico x Pico -> Pico -> Bool forall a. Ord a => a -> a -> Bool External instance of the constraint type forall k (a :: k). Ord (Fixed a) < Pico 10 = Char '0'Char -> String -> String forall a. a -> [a] -> [a] :(Bool -> Pico -> String forall {k} (a :: k). HasResolution a => Bool -> Fixed a -> String External instance of the constraint type HasResolution E12 showFixed Bool True Pico x) show2Fixed Pico x = Bool -> Pico -> String forall {k} (a :: k). HasResolution a => Bool -> Fixed a -> String External instance of the constraint type HasResolution E12 showFixed Bool True Pico x show2 :: (ShowPadded t) => t -> String show2 :: t -> String show2 = PadOption -> t -> String forall t. ShowPadded t => PadOption -> t -> String Evidence bound by a type signature of the constraint type ShowPadded t showPaddedNum (PadOption -> t -> String) -> PadOption -> t -> String forall a b. (a -> b) -> a -> b $ Int -> Char -> PadOption Pad Int 2 Char '0' show3 :: (ShowPadded t) => t -> String show3 :: t -> String show3 = PadOption -> t -> String forall t. ShowPadded t => PadOption -> t -> String Evidence bound by a type signature of the constraint type ShowPadded t showPaddedNum (PadOption -> t -> String) -> PadOption -> t -> String forall a b. (a -> b) -> a -> b $ Int -> Char -> PadOption Pad Int 3 Char '0' show4 :: (ShowPadded t) => t -> String show4 :: t -> String show4 = PadOption -> t -> String forall t. ShowPadded t => PadOption -> t -> String Evidence bound by a type signature of the constraint type ShowPadded t showPaddedNum (PadOption -> t -> String) -> PadOption -> t -> String forall a b. (a -> b) -> a -> b $ Int -> Char -> PadOption Pad Int 4 Char '0' mod100 :: (Integral i) => i -> i mod100 :: i -> i mod100 i x = i -> i -> i forall a. Integral a => a -> a -> a Evidence bound by a type signature of the constraint type Integral i mod i x i 100 div100 :: (Integral i) => i -> i div100 :: i -> i div100 i x = i -> i -> i forall a. Integral a => a -> a -> a Evidence bound by a type signature of the constraint type Integral i div i x i 100 clip :: (Ord t) => t -> t -> t -> t clip :: t -> t -> t -> t clip t a t _ t x | t x t -> t -> Bool forall a. Ord a => a -> a -> Bool Evidence bound by a type signature of the constraint type Ord t < t a = t a clip t _ t b t x | t x t -> t -> Bool forall a. Ord a => a -> a -> Bool Evidence bound by a type signature of the constraint type Ord t > t b = t b clip t _ t _ t x = t x clipValid :: (Ord t) => t -> t -> t -> Maybe t clipValid :: t -> t -> t -> Maybe t clipValid t a t _ t x | t x t -> t -> Bool forall a. Ord a => a -> a -> Bool Evidence bound by a type signature of the constraint type Ord t < t a = Maybe t forall a. Maybe a Nothing clipValid t _ t b t x | t x t -> t -> Bool forall a. Ord a => a -> a -> Bool Evidence bound by a type signature of the constraint type Ord t > t b = Maybe t forall a. Maybe a Nothing clipValid t _ t _ t x = t -> Maybe t forall a. a -> Maybe a Just t x quotBy :: (Real a,Integral b) => a -> a -> b quotBy :: a -> a -> b quotBy a d a n = Rational -> b forall a b. (RealFrac a, Integral b) => a -> b Evidence bound by a type signature of the constraint type Integral b External instance of the constraint type forall a. Integral a => RealFrac (Ratio a) External instance of the constraint type Integral Integer truncate ((a -> Rational forall a. Real a => a -> Rational Evidence bound by a type signature of the constraint type Real a toRational a n) Rational -> Rational -> Rational forall a. Fractional a => a -> a -> a External instance of the constraint type forall a. Integral a => Fractional (Ratio a) External instance of the constraint type Integral Integer / (a -> Rational forall a. Real a => a -> Rational Evidence bound by a type signature of the constraint type Real a toRational a d)) remBy :: Real a => a -> a -> a remBy :: a -> a -> a remBy a d a n = a n a -> a -> a forall a. Num a => a -> a -> a External instance of the constraint type forall a. Real a => Num a Evidence bound by a type signature of the constraint type Real a - (Integer -> a forall a. Num a => Integer -> a External instance of the constraint type forall a. Real a => Num a Evidence bound by a type signature of the constraint type Real a fromInteger Integer f) a -> a -> a forall a. Num a => a -> a -> a External instance of the constraint type forall a. Real a => Num a Evidence bound by a type signature of the constraint type Real a * a d where f :: Integer f = a -> a -> Integer forall a b. (Real a, Integral b) => a -> a -> b External instance of the constraint type Integral Integer Evidence bound by a type signature of the constraint type Real a quotBy a d a n quotRemBy :: (Real a,Integral b) => a -> a -> (b,a) quotRemBy :: a -> a -> (b, a) quotRemBy a d a n = let f :: b f = a -> a -> b forall a b. (Real a, Integral b) => a -> a -> b Evidence bound by a type signature of the constraint type Integral b Evidence bound by a type signature of the constraint type Real a quotBy a d a n in (b f,a n a -> a -> a forall a. Num a => a -> a -> a External instance of the constraint type forall a. Real a => Num a Evidence bound by a type signature of the constraint type Real a - (b -> a forall a b. (Integral a, Num b) => a -> b External instance of the constraint type forall a. Real a => Num a Evidence bound by a type signature of the constraint type Real a Evidence bound by a type signature of the constraint type Integral b fromIntegral b f) a -> a -> a forall a. Num a => a -> a -> a External instance of the constraint type forall a. Real a => Num a Evidence bound by a type signature of the constraint type Real a * a d)