This package provides the family of canonical finite sets, indexed by natural numbers giving their cardinality. In addition, we provide an implementation of type-level decimal numbers and arithmetic on them.
While this package uses complex type machinery, it should be easy to install. You should be able install it via the standard:
$> cabal install data-fin
While I usually try to keep things as portable as possible, this package relies on many GHC language extensions. Thus, no claim of portability ot non-GHC compilers is made. All the required language extensions are:
- CPP
- DeriveDataTypeable
- EmptyDataDecls
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- MultiParamTypeClasses
- Rank2Types
- ScopedTypeVariables
- TypeOperators
- Trustworthy - GHC >= 7.1 only
- UndecidableInstances