-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Additional type-level operations on GHC.TypeLits.Nat
--   
--   Additional type-level operations on <tt>GHC.TypeLits.Nat</tt>:
--   
--   <ul>
--   <li><tt>Max</tt>: type-level <a>max</a></li>
--   <li><tt>Min</tt>: type-level <a>min</a></li>
--   <li><tt>Div</tt>: type-level <a>div</a></li>
--   <li><tt>Mod</tt>: type-level <a>mod</a></li>
--   <li><tt>FLog</tt>: type-level equivalent of <a>integerLogBase#</a>
--   i.e. the exact integer equivalent to <tt>floor (logBase x y)</tt></li>
--   <li><tt>CLog</tt>: type-level equivalent of <i>the ceiling of</i>
--   <a>integerLogBase#</a> i.e. the exact integer equivalent to
--   <tt>ceiling (logBase x y)</tt></li>
--   <li><tt>Log</tt>: type-level equivalent of <a>integerLogBase#</a>
--   where the operation only reduces when <tt>floor (logBase b x) ~
--   ceiling (logBase b x)</tt></li>
--   <li><tt>GCD</tt>: a type-level <a>gcd</a></li>
--   <li><tt>LCM</tt>: a type-level <a>lcm</a></li>
--   </ul>
--   
--   And a custom solver for the above operations defined in
--   <tt>GHC.TypeLits.Extra.Solver</tt> as a GHC type-checker plugin. To
--   use the plugin, add the
--   
--   <pre>
--   OPTIONS_GHC -fplugin GHC.TypeLits.Extra.Solver
--   </pre>
--   
--   pragma to the header of your file.
@package ghc-typelits-extra
@version 0.2.3


-- | To use the plugin, add the
--   
--   <pre>
--   {-# OPTIONS_GHC -fplugin GHC.TypeLits.Extra.Solver #-}
--   </pre>
--   
--   pragma to the header of your file
module GHC.TypeLits.Extra.Solver

-- | A solver implement as a type-checker plugin for:
--   
--   <ul>
--   <li><a>Div</a>: type-level <a>div</a></li>
--   <li><a>Mod</a>: type-level <a>mod</a></li>
--   <li><a>FLog</a>: type-level equivalent of <a>integerLogBase#</a> .i.e.
--   the exact integer equivalent to "<tt><a>floor</a> (<a>logBase</a> x
--   y)</tt>"</li>
--   <li><a>CLog</a>: type-level equivalent of <i>the ceiling of</i>
--   <a>integerLogBase#</a> .i.e. the exact integer equivalent to
--   "<tt><a>ceiling</a> (<a>logBase</a> x y)</tt>"</li>
--   <li><a>Log</a>: type-level equivalent of <a>integerLogBase#</a> where
--   the operation only reduces when "<tt><a>floor</a> (<a>logBase</a> b x)
--   ~ <a>ceiling</a> (<a>logBase</a> b x)</tt>"</li>
--   <li><a>GCD</a>: a type-level <a>gcd</a></li>
--   <li><a>LCM</a>: a type-level <a>lcm</a></li>
--   </ul>
--   
--   To use the plugin, add
--   
--   <pre>
--   {-# OPTIONS_GHC -fplugin GHC.TypeLits.Extra.Solver #-}
--   </pre>
--   
--   To the header of your file.
plugin :: Plugin
instance Outputable.Outputable GHC.TypeLits.Extra.Solver.SimplifyResult


-- | Additional type-level operations on <a>Nat</a>:
--   
--   <ul>
--   <li><a>Max</a>: type-level <a>max</a></li>
--   <li><a>Min</a>: type-level <a>min</a></li>
--   <li><a>Div</a>: type-level <a>div</a></li>
--   <li><a>Mod</a>: type-level <a>mod</a></li>
--   <li><a>FLog</a>: type-level equivalent of <a>integerLogBase#</a> .i.e.
--   the exact integer equivalent to "<tt><a>floor</a> (<a>logBase</a> x
--   y)</tt>"</li>
--   <li><a>CLog</a>: type-level equivalent of <i>the ceiling of</i>
--   <a>integerLogBase#</a> .i.e. the exact integer equivalent to
--   "<tt><a>ceiling</a> (<a>logBase</a> x y)</tt>"</li>
--   <li><a>Log</a>: type-level equivalent of <a>integerLogBase#</a> where
--   the operation only reduces when "<tt><a>floor</a> (<a>logBase</a> b x)
--   ~ <a>ceiling</a> (<a>logBase</a> b x)</tt>"</li>
--   <li><a>GCD</a>: a type-level <a>gcd</a></li>
--   <li><a>LCM</a>: a type-level <a>lcm</a></li>
--   </ul>
--   
--   A custom solver for the above operations defined is defined in
--   <a>GHC.TypeLits.Extra.Solver</a> as a GHC type-checker plugin. To use
--   the plugin, add the
--   
--   <pre>
--   {-# OPTIONS_GHC -fplugin GHC.TypeLits.Extra.Solver #-}
--   </pre>
--   
--   pragma to the header of your file.
module GHC.TypeLits.Extra

-- | Type-level <a>max</a>

-- | Type-level <a>min</a>

-- | Type-level <a>div</a>
--   
--   Note that additional equations are provided by the type-checker plugin
--   solver <a>GHC.TypeLits.Extra.Solver</a>.

-- | Type-level <a>mod</a>
--   
--   Note that additional equations are provided by the type-checker plugin
--   solver <a>GHC.TypeLits.Extra.Solver</a>.

-- | Type-level <a>divMod</a>
type DivMod n d = '(Div n d, Mod n d)

-- | A variant of <a>Div</a> that rounds up instead of down
type DivRU n d = Div (n + (d - 1)) d

-- | Type-level equivalent of <a>integerLogBase#</a> .i.e. the exact
--   integer equivalent to "<tt><a>floor</a> (<a>logBase</a> x y)</tt>"
--   
--   Note that additional equations are provided by the type-checker plugin
--   solver <a>GHC.TypeLits.Extra.Solver</a>.

-- | Type-level equivalent of <i>the ceiling of</i> <a>integerLogBase#</a>
--   .i.e. the exact integer equivalent to "<tt><a>ceiling</a>
--   (<a>logBase</a> x y)</tt>"
--   
--   Note that additional equations are provided by the type-checker plugin
--   solver <a>GHC.TypeLits.Extra.Solver</a>.

-- | Type-level equivalent of <a>integerLogBase#</a> where the operation
--   only reduces when:
--   
--   <pre>
--   <a>FLog</a> b x ~ <a>CLog</a> b x
--   </pre>
--   
--   Additionally, the following property holds for <a>Log</a>:
--   
--   <pre>
--   (b ^ (Log b x)) ~ x
--   </pre>
--   
--   Note that additional equations are provided by the type-checker plugin
--   solver <a>GHC.TypeLits.Extra.Solver</a>.

-- | Type-level greatest common denominator (GCD).
--   
--   Note that additional equations are provided by the type-checker plugin
--   solver <a>GHC.TypeLits.Extra.Solver</a>.

-- | Type-level least common multiple (LCM).
--   
--   Note that additional equations are provided by the type-checker plugin
--   solver <a>GHC.TypeLits.Extra.Solver</a>.
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.LCMSym1
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.LCMSym0
instance (GHC.TypeLits.KnownNat x, GHC.TypeLits.KnownNat y) => GHC.TypeLits.KnownNat.KnownNat2 "GHC.TypeLits.Extra.LCM" x y
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.GCDSym1
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.GCDSym0
instance (GHC.TypeLits.KnownNat x, GHC.TypeLits.KnownNat y) => GHC.TypeLits.KnownNat.KnownNat2 "GHC.TypeLits.Extra.GCD" x y
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.LogSym1
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.LogSym0
instance (GHC.TypeLits.KnownNat x, GHC.TypeLits.KnownNat y, GHC.TypeLits.Extra.FLog x y ~ GHC.TypeLits.Extra.CLog x y) => GHC.TypeLits.KnownNat.KnownNat2 "GHC.TypeLits.Extra.Log" x y
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.CLogSym1
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.CLogSym0
instance (GHC.TypeLits.KnownNat x, GHC.TypeLits.KnownNat y, 2 GHC.TypeLits.<= x, 1 GHC.TypeLits.<= y) => GHC.TypeLits.KnownNat.KnownNat2 "GHC.TypeLits.Extra.CLog" x y
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.FLogSym1
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.FLogSym0
instance (GHC.TypeLits.KnownNat x, GHC.TypeLits.KnownNat y, 2 GHC.TypeLits.<= x, 1 GHC.TypeLits.<= y) => GHC.TypeLits.KnownNat.KnownNat2 "GHC.TypeLits.Extra.FLog" x y
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.ModSym1
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.ModSym0
instance (GHC.TypeLits.KnownNat x, GHC.TypeLits.KnownNat y, 1 GHC.TypeLits.<= y) => GHC.TypeLits.KnownNat.KnownNat2 "GHC.TypeLits.Extra.Mod" x y
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.DivSym1
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.DivSym0
instance (GHC.TypeLits.KnownNat x, GHC.TypeLits.KnownNat y, 1 GHC.TypeLits.<= y) => GHC.TypeLits.KnownNat.KnownNat2 "GHC.TypeLits.Extra.Div" x y
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.MinSym1
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.MinSym0
instance (GHC.TypeLits.KnownNat x, GHC.TypeLits.KnownNat y) => GHC.TypeLits.KnownNat.KnownNat2 "GHC.TypeLits.Extra.Min" x y
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.MaxSym1
instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings GHC.TypeLits.Extra.MaxSym0
instance (GHC.TypeLits.KnownNat x, GHC.TypeLits.KnownNat y) => GHC.TypeLits.KnownNat.KnownNat2 "GHC.TypeLits.Extra.Max" x y
