Package0.3.2DataDependent TypesSingletonsMath
fin
Nat and Fin: peano naturals and finite numbers
- Version0.3.2
- CategoryData, Dependent Types, Singletons, Math
- LicenceBSD-3-Clause
- AuthorOleg Grenrus <oleg.grenrus@iki.fi>
- MaintainerOleg.Grenrus <oleg.grenrus@iki.fi>
- Homepagegithub.com/phadej/vec
- Pinned byhackage fin 0.3.2
- Sourcehackage.haskell.org/package/fin-0.3.2
Modules
6 modules- Data.Fin34Finite numbers. This module is designed to be imported as import Data.Fin (Fin (..))
- Data.Nat16Nat numbers. This module is designed to be imported qualified.
- Data.Type.Nat54Nat numbers. DataKinds stuff. This module re-exports Data.Nat, and adds type-level things.
- Data.Type.Nat.LE15Less-than-or-equal relation for (unary) natural numbers Nat. There are at least three ways to encode this relation. zero : 0 \le m and su…
- Data.Type.Nat.LE.ReflStep15
- Data.Type.Nat.LT6
Description
This package provides two simple types, and some tools to work with them. Also on type level as DataKinds.
-- Peano naturals data Nat = Z | S Nat -- Finite naturals data Fin (n :: Nat) where Z :: Fin ('S n) S :: Fin n -> Fin ('Nat.S n)
vec implements length-indexed (sized) lists using this package for indexes.
The Data.Fin.Enum module let's work generically with enumerations.
See Hasochism: the pleasure and pain of dependently typed haskell programming by Sam Lindley and Conor McBride for answers to how and why. Read APLicative Programming with Naperian Functors by Jeremy Gibbons for (not so) different ones.
finite-typelits . Is a great package, but uses GHC.TypeLits. type-natural depends on singletons package. fin will try to stay light on the dependencies, and support as many GHC versions as practical. peano is very incomplete nat as well. PeanoWitnesses doesn't use DataKinds. type-combinators is big package too.
Depends on
8 packages- QuickCheck-2.15.0.1in this set
- base-4.20.2.0with GHC
- boring-0.2.2in this set
- dec-0.0.6in this set
- deepseq-1.5.0.0with GHC
- hashable-1.4.7.0in this set
- some-1.0.6in this set
- universe-base-1.1.4in this set