fin
Version 0.1 revision 1 uploaded by phadej.
Package meta
- Synopsis
- Nat and Fin: peano naturals and finite numbers
- 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.
Similar packages
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.
- Author
- Oleg Grenrus <oleg.grenrus@iki.fi>
- Bug reports
- https://github.com/phadej/vec/issues
- Category
- Data, Dependent Types, Singletons
- Copyright
- (c) 2017-2019 Oleg Grenrus
- Homepage
- https://github.com/phadej/vec
- Maintainer
- Oleg.Grenrus <oleg.grenrus@iki.fi>
- Package URL
- n/a
- Stability
- n/a