ghc-typelits-extra-0.4.8: Additional type-level operations on GHC.TypeLits.Nat

Copyright | (C) 2015-2016 University of Twente
License | BSD2 (see the file LICENSE)
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com>
Safe Haskell | None
Language | Haskell2010

Extensions

- Cpp
- TemplateHaskellQuotes
- TupleSections

GHC.TypeLits.Extra.Solver

Description

To use the plugin, add the

    {-# OPTIONS_GHC -fplugin GHC.TypeLits.Extra.Solver #-}

pragma to the header of your file

Synopsis

- plugin :: Plugin

# Documentation

plugin :: Plugin Source #

A solver implement as a type-checker plugin for:

- `Div`: type-level `div`
- `Mod`: type-level `mod`
- `FLog`: type-level equivalent of integerLogBase# .i.e. the exact integer equivalent to "``floor` (`logBase` x y)`"
- `CLog`: type-level equivalent of the ceiling of integerLogBase# .i.e. the exact integer equivalent to "``ceiling` (`logBase` x y)`"
- `Log`: type-level equivalent of integerLogBase# where the operation only reduces when "``floor` (`logBase` b x) ~ `ceiling` (`logBase` b x)`"
- `GCD`: a type-level `gcd`
- `LCM`: a type-level `lcm`

To use the plugin, add

    {-# OPTIONS_GHC -fplugin GHC.TypeLits.Extra.Solver #-}

To the header of your file.