Package Info

ghc-ghc-typelits-extra


Additional type-level operations on GHC.TypeLits.Nat


Development/Libraries/Haskell

Additional type-level operations on 'GHC.TypeLits.Nat':

  • 'Max': type-level

<http://hackage.haskell.org/package/base-4.8.2.0/docs/Prelude.html#v:max max>

  • 'Min': type-level

<http://hackage.haskell.org/package/base-4.8.2.0/docs/Prelude.html#v:min min>

  • 'Div': type-level

<http://hackage.haskell.org/package/base-4.8.2.0/docs/Prelude.html#v:div div>

  • 'Mod': type-level

<http://hackage.haskell.org/package/base-4.8.2.0/docs/Prelude.html#v:mod mod>

  • 'FLog': type-level equivalent of

<https://hackage.haskell.org/package/integer-gmp/docs/GHC-Integer-Logarithms.html#v:integerLogBase-35- integerLogBase#> i.e. the exact integer equivalent to 'floor (logBase x y)'

  • 'CLog': type-level equivalent of /the ceiling of/

<https://hackage.haskell.org/package/integer-gmp/docs/GHC-Integer-Logarithms.html#v:integerLogBase-35- integerLogBase#> i.e. the exact integer equivalent to 'ceiling (logBase x y)'

  • 'Log': type-level equivalent of

<https://hackage.haskell.org/package/integer-gmp/docs/GHC-Integer-Logarithms.html#v:integerLogBase-35- integerLogBase#> where the operation only reduces when 'floor (logBase b x) ~ ceiling (logBase b x)'

  • 'GCD': a type-level

<http://hackage.haskell.org/package/base-4.8.2.0/docs/Prelude.html#v:gcd gcd>

  • 'LCM': a type-level

<http://hackage.haskell.org/package/base-4.8.2.0/docs/Prelude.html#v:lcm lcm>

And a custom solver for the above operations defined in 'GHC.TypeLits.Extra.Solver' as a GHC type-checker plugin. To use the plugin, add the

' OPTIONS_GHC -fplugin GHC.TypeLits.Extra.Solver '

pragma to the header of your file.


License: BSD-2-Clause
URL: https://hackage.haskell.org/package/ghc-typelits-extra

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.2.3-bp150.1.3 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • x86-64
  • ghc-ghc-typelits-extra
  • ghc-ghc-typelits-extra-devel