{-# LANGUAGE CPP, NoImplicitPrelude #-}
module Data.Ratio.Compat (
module Base
#if MIN_VERSION_base(4,4,0) && !(MIN_VERSION_base(4,9,0))
, denominator
, numerator
#endif
) where
#if !(MIN_VERSION_base(4,4,0)) || MIN_VERSION_base(4,9,0)
import Data.Ratio as Base
#else
import Data.Ratio as Base hiding (
denominator
, numerator
)
import GHC.Real (Ratio(..))
#endif
#if MIN_VERSION_base(4,4,0) && !(MIN_VERSION_base(4,9,0))
numerator :: Ratio a -> a
numerator (x :% _) = x
denominator :: Ratio a -> a
denominator (_ :% y) = y
#endif